zio.temporal.promise.ZAsync
See theZAsync companion object
Contains result of an asynchronous computation. Similar to zio.IO with the following differences:
-
Can be used only inside a Temporal workflow code. Use zio.ZIO and its derivatives to implement activities and workflow starting and querying code.
run
method doesn't throw InterruptedException. The only way to unblockrun
is to complete the ZAsync -
ZAsync doesn't directly supports cancellation. Use io.temporal.workflow.CancellationScope to cancel and handle cancellations. The pattern is that a canceled operation completes its ZAsync with io.temporal.failure.CanceledFailure when canceled.
-
Unlike zio.IO (that is '''lazy'''), ZAsync is '''strict'''. Whenever a ZAsync is created, The thunk is immediately started