ZAsync

zio.temporal.workflow.ZAsync
See theZAsync companion object
sealed trait ZAsync[+A]

Contains result of an asynchronous computation. Similar to zio.IO with the following differences:

  1. 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 unblock run is to complete the ZAsync

  2. 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.

  3. Unlike zio.IO (that is '''lazy'''), ZAsync is '''strict'''. Whenever a ZAsync is created, The thunk is immediately started

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
ZAsync[A]

Members list

Value members

Abstract methods

def catchAll[A0 >: A](f: Throwable => ZAsync[A0]): ZAsync[A0]
def catchSome[A0 >: A](pf: PartialFunction[Throwable, ZAsync[A0]]): ZAsync[A0]
def flatMap[B](f: A => ZAsync[B]): ZAsync[B]
def map[B](f: A => B): ZAsync[B]
def run: Result[NoEffects, A]

Blocks until the promise completes

Blocks until the promise completes

Attributes

Returns

either result or error

def run(timeout: Duration): Result[Timeout, A]
def runCancellable(timeout: Duration): Result[Cancel & Timeout, A]

Concrete methods

def as[B](value: => B): ZAsync[B]
final def ignore: ZAsync[Unit]

Ignore any errors

Ignore any errors

Attributes

final def option: ZAsync[Option[A]]

Return None if error occurred

Return None if error occurred

Attributes

final def tap(f: A => Unit): ZAsync[A]
final def tapError(f: Throwable => Unit): ZAsync[A]
def unit: ZAsync[Unit]
final def zipPar[B, C](that: ZAsync[B])(f: (A, B) => C): ZAsync[C]

The only difference with zipWith is that that is by-value. Therefore, left ZAsync is already started

The only difference with zipWith is that that is by-value. Therefore, left ZAsync is already started

Attributes

final def zipWith[B, C](that: => ZAsync[B])(f: (A, B) => C): ZAsync[C]