InMemoryDomainEventBus
class InMemoryDomainEventBus(val sinkSupplier: (NamedAggregate) -> Sinks.Many<DomainEventStream> = {
Sinks.many().multicast().onBackpressureBuffer()
}) : InMemoryMessageBus<DomainEventStream, EventStreamExchange> , LocalDomainEventBus
In-memory implementation of LocalDomainEventBus.
This class provides an in-memory message bus for domain events, suitable for testing or single-process applications. It uses reactive sinks to handle event publishing and subscription within the same JVM instance.
Parameters
sinkSupplier
The function to create sinks for named aggregates
See also
Constructors
Link copied to clipboard
constructor(sinkSupplier: (NamedAggregate) -> Sinks.Many<DomainEventStream> = {
Sinks.many().multicast().onBackpressureBuffer()
})
Creates a new InMemoryDomainEventBus with the specified sink supplier
Properties
Functions
Link copied to clipboard
Creates an EventStreamExchange from a DomainEventStream.
Link copied to clipboard
Wraps a LocalDomainEventBus with metrics collection capabilities. Returns a MetricLocalDomainEventBus that collects metrics on domain event operations.
Link copied to clipboard
Receives messages for the specified named aggregates.
Link copied to clipboard
Sends a message through the in-memory bus.
Link copied to clipboard
Returns the number of subscribers for the specified named aggregate.