Skip to content

Conversation

@TopSwagCode
Copy link
Owner

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for synchronous void delegates (Action/Action) in background workers, in addition to the existing async delegate support (Func/Func<T, Task>). Previously, only async delegates or synchronous delegates returning Task were properly handled.

Changes:

  • Updated delegate analysis logic to distinguish between async and sync delegates
  • Modified code generation to conditionally await async delegates or directly invoke sync delegates
  • Updated delegate type generation to return Action for sync delegates and Func for async delegates

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/MinimalWorker.Generators/WorkerGenerator.cs Added logic to handle sync (void) vs async (Task) delegate return types, with whitespace cleanup
src/MinimalWorker.Generators/WorkerEmitter.cs Updated GetDelegateType to return Action for sync delegates and modified all three worker init methods to conditionally await based on delegate type

@TopSwagCode TopSwagCode merged commit ea7c494 into master Jan 19, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants