sealed trait ZAsync[+A] extends AnyRef
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
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
- Self Type
- ZAsync[A]
- Alphabetic
- By Inheritance
- ZAsync
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def catchAll[A0 >: A](f: (Throwable) => ZAsync[A0]): ZAsync[A0]
- abstract def catchSome[A0 >: A](pf: PartialFunction[Throwable, ZAsync[A0]]): ZAsync[A0]
- abstract def flatMap[B](f: (A) => ZAsync[B]): ZAsync[B]
- abstract def map[B](f: (A) => B): ZAsync[B]
- abstract def run(timeout: zio.Duration): Result[Timeout, A]
- abstract def run: Result[NoEffects, A]
Blocks until the promise completes
Blocks until the promise completes
- returns
either result or error
- abstract def runCancellable(timeout: zio.Duration): Result[Cancel with Timeout, A]
- abstract def runCancellable: Result[Cancel, A]
- abstract val underlying: io.temporal.workflow.Promise[A]
- Attributes
- protected
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def as[B](value: => B): ZAsync[B]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def ignore: ZAsync[Unit]
Ignore any errors
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def option: ZAsync[Option[A]]
Return None if error occurred
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- final def tap(f: (A) => Unit): ZAsync[A]
- final def tapError(f: (Throwable) => Unit): ZAsync[A]
- def toString(): String
- Definition Classes
- AnyRef → Any
- def unit: ZAsync[Unit]
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def zipPar[B, C](that: ZAsync[B])(f: (A, B) => C): ZAsync[C]
The only difference with
zipWith
is thatthat
is by-value.The only difference with
zipWith
is thatthat
is by-value. Therefore, left ZAsync is already started - final def zipWith[B, C](that: => ZAsync[B])(f: (A, B) => C): ZAsync[C]
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)