Flow Based Saga Executor
Flow-based saga executor that emits events as a reactive stream.
This executor wraps a standard SagaExecutor and provides Flow-based event streaming for reactive consumption of saga lifecycle events.
Usage Example
val executor = sagaExecutor<OrderContext, OrderResult> {
step("reserve") { context -> /* ... */}
step("charge") { context -> /* ... */}
}.asFlow()
// Collect events reactively
launch {
executor.events.collect { event ->
println("Event: $event")
}
}
// Execute saga
val result = executor.execute(context)Parameters
The type of context passed to saga steps
The type of result produced by saga steps
Properties
Functions
Add an interceptor to observe and potentially veto saga step execution.
Add a monitor to observe saga events.
Extension function to convert a SagaExecutor to a FlowBasedSagaExecutor.
Entry point for all audit DSL forms.
Execute the saga with the given context.
Execute the saga with the given context, coroutine context, and optional timeout.
Execute the saga with an explicit runId for journal-aware runs.
Execute saga and return a Flow that emits all events followed by a terminal result event.
Remove a previously registered interceptor.
Remove a monitor.
Resumes a stateless saga from its journal.