RejectionBinding

One @OnRejected handler of a saga, bound to its processor instance: what the compiler generates for each @OnRejected function of a @Saga. It belongs to the saga's ProcessorBindings (ProcessorBinding.rejections), since it takes the rejections of the commands the saga's own handlers derive, not entries of the log; like them, it knows no runtime.

  • commandType is the C of the CommandReceipt.Rejected<C> it takes: it handles the rejections of the commands of that class (or a subclass); null for CommandReceipt.Rejected<*>, 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 that compensate, of the requests it returns (requestsOf), as a saga's handler derives its commands.

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 rejections of the commands of command: those its commandType names, or every one.

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

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

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