Full

class Full<A>(action: suspend SagaEffect.() -> A, compensation: suspend (A) -> Unit) : Saga<A>

Full for a Saga that defines both action and Full.compensation.

Constructors

Full
Link copied to clipboard
fun <A> Full(action: suspend SagaEffect.() -> A, compensation: suspend (A) -> Unit)

Functions

compensate
Link copied to clipboard
open infix fun compensate(compensate: suspend (A) -> Unit): Saga<A>
Add a compensating action to a Saga.
parZip
Link copied to clipboard
open fun <B, C> parZip(other: Saga<B>, transform: suspend CoroutineScope.(A, B) -> C): Saga<C>
open fun <B, C, D> parZip(ctx: CoroutineContext, b: Saga<B>, c: Saga<C>, f: suspend CoroutineScope.(A, B, C) -> D): Saga<D>
open fun <B, C, D, E> parZip(ctx: CoroutineContext, b: Saga<B>, c: Saga<C>, d: Saga<D>, f: suspend CoroutineScope.(A, B, C, D) -> E): Saga<E>
open fun <B, C, D, E, F> parZip(ctx: CoroutineContext, b: Saga<B>, c: Saga<C>, d: Saga<D>, e: Saga<E>, f: suspend CoroutineScope.(A, B, C, D, E) -> F): Saga<F>
open fun <B, C, D, E, F, G> parZip(ctx: CoroutineContext, b: Saga<B>, c: Saga<C>, d: Saga<D>, e: Saga<E>, ff: Saga<F>, f: suspend CoroutineScope.(A, B, C, D, E, F) -> G): Saga<G>
open fun <B, C, D, E, F, G, H> parZip(ctx: CoroutineContext, b: Saga<B>, c: Saga<C>, d: Saga<D>, e: Saga<E>, ff: Saga<F>, g: Saga<G>, f: suspend CoroutineScope.(A, B, C, D, E, F, G) -> H): Saga<H>
open fun <B, C, D, E, F, G, H, I> parZip(ctx: CoroutineContext, b: Saga<B>, c: Saga<C>, d: Saga<D>, e: Saga<E>, ff: Saga<F>, g: Saga<G>, h: Saga<H>, f: suspend CoroutineScope.(A, B, C, D, E, F, G, H) -> I): Saga<I>
open fun <B, C> parZip(ctx: CoroutineContext, other: Saga<B>, transform: suspend CoroutineScope.(A, B) -> C): Saga<C>
Runs multiple Sagas in parallel and combines the result with the transform function.
transact
Link copied to clipboard
open suspend fun transact(): A
Transact runs the Saga turning it into a suspend effect that results in A.

Properties

action
Link copied to clipboard
val action: suspend SagaEffect.() -> A
compensation
Link copied to clipboard
val compensation: suspend (A) -> Unit

Sources

jvm source
Link copied to clipboard