parZip

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. When one of the two Saga fails then it will cancel the other, if the other Saga already finished then its compensating action will be run.

If the resulting Saga is cancelled, then all composed Sagas will also cancel. All actions that already ran will get compensated first.


fun <B, C> parZip(other: Saga<B>, transform: suspend CoroutineScope.(A, B) -> C): Saga<C>
fun <B, C, D> parZip(ctx: CoroutineContext, b: Saga<B>, c: Saga<C>, f: suspend CoroutineScope.(A, B, C) -> D): Saga<D>
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>
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>
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>
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>
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>