CommittedBinding

One @OnCommitted handler of a saga, bound to its processor instance, the counterpart of RejectionBinding: what the compiler generates for each @OnCommitted function of a @Saga. It belongs to the saga's ProcessorBindings (ProcessorBinding.commits), since it takes the success receipts of the commands the saga's own handlers derive; like them, it knows no runtime.

  • commandType is the C of the CommandReceipt.Committed<C> it takes: it handles the receipts of the commands of that class (or a subclass); null for CommandReceipt.Committed<*>, every command the saga derives (handles).

  • blocking (@Blocking) asks the runtime to run the call on virtual threads instead of inline.

  • sends are the commands it declares it derives, schedules and calls (@Sends, its return type for what it derives): its context holds it to them.

  • invoke calls the handler directly and returns the commands of the requests it returns (requestsOf), as a saga's handler does.

Built with of.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The handler function's name.

Link copied to clipboard

The handler's name, processor.function, as the Manifest lists it.

Link copied to clipboard

The saga's name: its @Name, or its class's simple name.

Link copied to clipboard

What the handler declares it sends (@Sends, else its return type for what it derives).

Functions

Link copied to clipboard
fun handles(command: Class<*>): Boolean

Whether it takes the receipts of the commands of command: those its commandType names, or every one.

Link copied to clipboard
suspend fun invoke(committed: CommandReceipt.Committed<*>, context: SagaContext): List<Command<*>>

Calls the handler with committed, of a command it handles, and the context the receipt is handled in (committedContextOf), in the caller's coroutine: running a blocking one elsewhere is the runtime's.

Link copied to clipboard
open override fun toString(): String