step

infix fun <C, R> SagaBuilder<C, R>.step(name: String): StepActionBuilder<C, R>

Alternative syntax: "step 'name' does { ... }"

This provides a more concise alternative to "first do / then do".

Example:

step "reserve-inventory" does { context ->
inventoryService.reserve(context.items)
}

Alternative syntax: "step 'name' does { ... }"

Example:

step "take-payment" does { cart ->
updateState { it.copy(amount = payment.amount) }
createTransaction(cart, payment)
}