InMemoryCommandBus

class InMemoryCommandBus(val sinkSupplier: (NamedAggregate) -> Sinks.Many<CommandMessage<*>> = { mpscUnicastManySink() }) : InMemoryMessageBus<CommandMessage<*>, ServerCommandExchange<*>> , LocalCommandBus

In-memory implementation of CommandBus for local command processing. This bus uses unicast sinks to ensure each command has exactly one consumer, making it suitable for single-instance or testing scenarios.

Author

ahoo wang

Parameters

sinkSupplier

Function that creates a unicast sink for each named aggregate. Defaults to an atomic MPSC unicast sink with backpressure buffer.

Constructors

Link copied to clipboard
constructor(sinkSupplier: (NamedAggregate) -> Sinks.Many<CommandMessage<*>> = { mpscUnicastManySink() })

Properties

Link copied to clipboard
open override val sinkSupplier: (NamedAggregate) -> Sinks.Many<CommandMessage<*>>

Supplier for creating sinks for command distribution. Uses atomic MPSC admission and unicast mode to support concurrent senders while ensuring each command reaches exactly one consumer.

Functions

Link copied to clipboard

Creates a server command exchange for the given command message. This exchange handles the command processing lifecycle.