monitor

Add a monitor to observe saga events.

Monitors are notified of all saga lifecycle events, enabling logging, metrics collection, and other observability features.

Return

This builder for method chaining

Parameters

monitor

The monitor to add


fun monitor(handler: suspend (SagaEvent) -> Unit): StatefulSagaBuilder<C, R, S>

Add a monitor using a lambda.

Return

This builder for method chaining

Parameters

handler

Suspend function to handle saga events