workflow-kotlin
workflow-kotlin copied to clipboard
Add lock for render pass if we want to use a non-single threaded `CoroutineDispatcher` in the context for the runtime.
trafficstars
Otherwise, worker output (or anything sending to the sink like actions too) could happen during a render pass and we would get a lot of:
java.lang.UnsupportedOperationException: Expected sink to not be sent to until after the render pass. Received action: EmitWorkerOutputAction(worker=TypedWorker(), key=my_worker)
If we lock handling actions in the sink during the render pass then we could allow this parallelism.
For now we can only handle single-threaded dispatchers.