Skip to content

Commit 389e6a1

Browse files
committed
Move sink.send to MainActor run block
1 parent 04a8cd0 commit 389e6a1

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

WorkflowConcurrency/Sources/AsyncSequenceWorker.swift

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ struct AsyncSequenceWorkerWorkflow<WorkerType: AsyncSequenceWorker>: Workflow {
5555
guard let output = output as? Output else {
5656
fatalError("Unexpected output type \(type(of: output)) from worker \(worker)")
5757
}
58-
await sendAction(output: output, sink: sink)
58+
await MainActor.run {
59+
sink.send(AnyWorkflowAction(sendingOutput: output))
60+
}
5961
}
6062
}
6163

@@ -64,9 +66,4 @@ struct AsyncSequenceWorkerWorkflow<WorkerType: AsyncSequenceWorker>: Workflow {
6466
}
6567
}
6668
}
67-
68-
@MainActor
69-
func sendAction(output: Output, sink: Sink<AnyWorkflowAction<AsyncSequenceWorkerWorkflow<WorkerType>>>) {
70-
sink.send(AnyWorkflowAction(sendingOutput: output))
71-
}
7269
}

0 commit comments

Comments
 (0)