saga
DSL function for creating a saga.
Example:
val saga = saga<OrderResult> {
step(
name = "Reserve inventory",
action = { inventoryService.reserve(items) },
compensation = { result -> inventoryService.release(result) }
)
step(
name = "Process payment",
action = { paymentService.charge(amount) },
compensation = { result -> paymentService.refund(result) }
)
}Content copied to clipboard