Package-level declarations

Types

Link copied to clipboard
sealed interface ResumeOutcome<out R, out S>
Link copied to clipboard
fun interface StateReducer<S, P>

User-supplied fold function for reconstructing saga state from a journal.

Link copied to clipboard
fun interface TerminalDecoder<P, R>

User-supplied decoder that extracts a saga result R and TerminalOutcome from a journal Terminal entry's payload P.

Link copied to clipboard
fun interface TerminalEncoder<P>

User-supplied encoder that produces a journal Terminal entry payload P for a given TerminalOutcome.

Link copied to clipboard

Characterises how a completed saga run ended.

Functions

Link copied to clipboard
suspend fun <C, R, S : Any> StatefulSagaExecutor<C, R, S>.resume(runId: RunId, context: C): ResumeOutcome<R, S>

Resumes a stateful saga from its journal using the executor's pre-wired journal configuration.

suspend fun <C, R, P> SagaExecutor<C, R>.resume(runId: RunId, context: C, journal: SagaJournal<P>): ResumeOutcome<R, Unit>

Resumes a stateless saga from its journal.

suspend fun <C, R, S : Any, P> StatefulSagaExecutor<C, R, S>.resume(runId: RunId, context: C, journal: SagaJournal<P>): ResumeOutcome<R, S>

Resumes a stateful saga from its journal.

suspend fun <C, R, S : Any, P> StatefulSagaExecutor<C, R, S>.resume(runId: RunId, context: C, journal: SagaJournal<P>, initialState: S, reducer: StateReducer<S, P>, terminalDecoder: TerminalDecoder<P, R>, terminalEncoder: TerminalEncoder<P>? = null): ResumeOutcome<R, S>

Resumes a stateful saga from its journal when state reconstruction and Terminal decoding are required.