Class/Object

com.vladkopanev.zio.saga

Saga

Related Docs: object Saga | package saga

Permalink

final class Saga[-R, +E, +A] extends AnyVal

A Saga is an immutable structure that models a distributed transaction.

Self Type
Saga[R, E, A]
See also

Saga pattern Saga class has three type parameters - R for environment, E for errors and A for successful result. Saga wraps a ZIO that carries the compensating action in both error and result channels and enables a composition with another Sagas in for-comprehensions. If error occurs Saga will execute compensating actions starting from action that corresponds to failed request till the first already completed request.

Linear Supertypes
AnyVal, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Saga
  2. AnyVal
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def flatMap[R1 <: R, E1 >: E, B](f: (A) ⇒ Saga[R1, E1, B]): Saga[R1, E1, B]

    Permalink

    Sequences the result of this Saga to the next Saga.

  6. def flatten[R1 <: R, E1 >: E, B](implicit ev: <:<[A, Saga[R1, E1, B]]): Saga[R1, E1, B]

    Permalink

    Flattens the structure of this Saga by executing outer Saga first and then executes inner Saga.

  7. def getClass(): Class[_ <: AnyVal]

    Permalink
    Definition Classes
    AnyVal → Any
  8. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  9. def map[B](f: (A) ⇒ B): Saga[R, E, B]

    Permalink

    Maps the resulting value A of this Saga to value B with function f.

  10. def toString(): String

    Permalink
    Definition Classes
    Any
  11. def transact: ZIO[R, E, A]

    Permalink

    Materializes this Saga to ZIO effect.

  12. def zipPar[R1 <: R, E1 >: E, B](that: Saga[R1, E1, B]): Saga[R1, E1, (A, B)]

    Permalink

    Returns Saga that will execute this Saga in parallel with other, combining the result in a tuple.

    Returns Saga that will execute this Saga in parallel with other, combining the result in a tuple. Both compensating actions would be executed in case of failure.

  13. def zipWithPar[R1 <: R, E1 >: E, B, C](that: Saga[R1, E1, B])(f: (A, B) ⇒ C): Saga[R1, E1, C]

    Permalink

    Returns Saga that will execute this Saga in parallel with other, combining the result with specified function f.

    Returns Saga that will execute this Saga in parallel with other, combining the result with specified function f. Both compensating actions would be executed in case of failure.

  14. def zipWithParAll[R1 <: R, E1 >: E, B, C](that: Saga[R1, E1, B])(f: (A, B) ⇒ C)(g: (Compensator[R1, E1], Compensator[R1, E1]) ⇒ Compensator[R1, E1]): Saga[R1, E1, C]

    Permalink

    Returns Saga that will execute this Saga in parallel with other, combining the result with specified function f and combining the compensating actions with function g (this allows user to choose a strategy of running both compensating actions e.g.

    Returns Saga that will execute this Saga in parallel with other, combining the result with specified function f and combining the compensating actions with function g (this allows user to choose a strategy of running both compensating actions e.g. in sequence or in parallel).

Inherited from AnyVal

Inherited from Any

Ungrouped