Skip to content

Move AnyAsyncSequenceWorker into WorkflowConcurrency as AsyncSequenceWorker #353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mjohnson12
Copy link
Collaborator

This moves AnyAsyncSequenceWorker from WorkflowExperimental in register into WorkflowConcurrency as AsyncSequenceWorker.

Checklist

  • Unit Tests
  • UI Tests
  • Snapshot Tests (iOS only)
  • I have made corresponding changes to the documentation

@mjohnson12 mjohnson12 force-pushed the markj/asyncsequence_worker branch from e7ec195 to 04a8cd0 Compare June 2, 2025 15:16
@mjohnson12 mjohnson12 changed the title Move AnyAsyncSequence into WorkflowConcurrency as AsyncSequenceWorker Move AnyAsyncSequenceWorker into WorkflowConcurrency as AsyncSequenceWorker Jun 2, 2025
guard let output = output as? Output else {
fatalError("Unexpected output type \(type(of: output)) from worker \(worker)")
}
await sendAction(output: output, sink: sink)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If I change this to do what the async function worker does to call send on sink by adding:

let send: @MainActor (Output) -> Void = sink.send

It crashes the compiler

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Pushing up a change to just call MainActor run so we don't need the sendAction function just to call sink.send on the main actor.

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.

1 participant