ZAsync

zio.temporal.workflow.ZAsync$
See theZAsync companion trait
object ZAsync

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
ZAsync.type

Members list

Type members

Classlikes

sealed trait Cancel extends NoEffects

Attributes

Supertypes
trait NoEffects
class Object
trait Matchable
class Any
case class Cancelled(failure: CanceledFailure) extends Result[Cancel, Nothing]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Result[Cancel, Nothing]
class Object
trait Matchable
class Any
Show all
case class Failure(error: Throwable) extends Result[NoEffects, Nothing]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Result[NoEffects, Nothing]
class Object
trait Matchable
class Any
Show all
sealed trait NoEffects

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Cancel
trait Timeout
object Result

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Result.type
sealed trait Result[-C <: NoEffects, +A]

Represents ZAsync execution result

Represents ZAsync execution result

Type parameters

A

value type

C

ZAsync effect (either NoEffects or Cancel or Timeout

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Cancelled
class Failure
class Success[A]
class TimedOut
case class Success[A](value: A) extends Result[NoEffects, A]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Result[NoEffects, A]
class Object
trait Matchable
class Any
Show all
case class TimedOut(failure: TimeoutException) extends Result[Timeout, Nothing]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Result[Timeout, Nothing]
class Object
trait Matchable
class Any
Show all
sealed trait Timeout extends NoEffects

Attributes

Supertypes
trait NoEffects
class Object
trait Matchable
class Any

Value members

Concrete methods

def attempt[A](thunk: => A): ZAsync[A]

Suspends side effect execution within ZAsync

Suspends side effect execution within ZAsync

Type parameters

A

value type

Value parameters

thunk

effectful side effect (which may throw exceptions)

Attributes

Returns

suspended promise

def collectAll[A, Collection <: (Iterable)](in: Collection[ZAsync[A]])(implicit bf: BuildFrom[Collection[ZAsync[A]], A, Collection[A]]): ZAsync[Collection[A]]

Similar to zio.ZIO.collectAll for collections

Similar to zio.ZIO.collectAll for collections

Value parameters

in

sequence of ZAsync

Attributes

Returns

promise with collected results or failure

def collectAllDiscard(in: Iterable[ZAsync[Any]]): ZAsync[Unit]

Returns ZAsync that becomes completed when all promises in the collection are completed. A single promise failure causes resulting promise to deliver the failure immediately.

Returns ZAsync that becomes completed when all promises in the collection are completed. A single promise failure causes resulting promise to deliver the failure immediately.

Value parameters

in

async computations to wait for.

Attributes

Returns

ZAsync that is completed with null when all the argument promises become completed.

def fail(error: Throwable): ZAsync[Nothing]

Creates failed ZAsync

Creates failed ZAsync

Value parameters

error

the error

Attributes

Returns

promise completed with error

def foreach[A, B](in: Option[A])(f: A => ZAsync[B]): ZAsync[Option[B]]

Similar to zio.ZIO.foreach for Option

Similar to zio.ZIO.foreach for Option

Value parameters

f

value handler

in

optional value

Attributes

Returns

promise with collected result, None or failure

def foreach[A, B, Collection <: (Iterable)](in: Collection[A])(f: A => ZAsync[B])(implicit bf: BuildFrom[Collection[A], B, Collection[B]]): ZAsync[Collection[B]]

Similar to zio.ZIO.foreach for collections

Similar to zio.ZIO.foreach for collections

Value parameters

f

value handler

in

sequence of values

Attributes

Returns

promise with collected results or failure

def foreachPar[A, B, Collection <: (Iterable)](in: Collection[A])(f: A => ZAsync[B])(implicit bf: BuildFrom[Collection[A], B, Collection[B]]): ZAsync[Collection[B]]

Similar to zio.ZIO.foreachPar for collections

Similar to zio.ZIO.foreachPar for collections

Value parameters

f

value handler

in

sequence of values

Attributes

Returns

promise with collected results or failure

def foreachParDiscard[A](in: Iterable[A])(f: A => ZAsync[Any]): ZAsync[Unit]

Similar to zio.ZIO.foreachParDiscard for collections

Similar to zio.ZIO.foreachParDiscard for collections

Value parameters

f

value handler

in

sequence of values

Attributes

Returns

promise which succeeds if all ZAsync succeed

def fromEither[A](thunk: => Either[Throwable, A]): ZAsync[A]

Suspends side effect execution within ZAsync

Suspends side effect execution within ZAsync

Type parameters

A

value type

Value parameters

thunk

side effect

Attributes

Returns

suspended promise

def fromJava[A](promise: Promise[A]): ZAsync[A]

Wraps Temporal's Promise into ZAsync

Wraps Temporal's Promise into ZAsync

Type parameters

A

value type

Value parameters

promise

the promise

Attributes

Returns

promise wrapped

def raceFirst[A](in: Iterable[ZAsync[A]]): ZAsync[A]

Returns ZAsync that becomes completed when any of the arguments is completed. If it completes exceptionally then result is also completes exceptionally.

Returns ZAsync that becomes completed when any of the arguments is completed. If it completes exceptionally then result is also completes exceptionally.

Attributes

def succeed[A](value: A): ZAsync[A]

Creates successfully completed ZAsync

Creates successfully completed ZAsync

Type parameters

A

value type

Value parameters

value

the value

Attributes

Returns

promise completed with value

def unit: ZAsync[Unit]