EventStreamDispatcher

class EventStreamDispatcher(val name: String, val parallelism: Int, val messageBus: DomainEventBus, val functionRegistrar: MessageFunctionRegistrar<MessageFunction<Any, DomainEventExchange<*>, Mono<*>>>, val eventHandler: EventHandler, val schedulerSupplier: AggregateSchedulerSupplier) : AbstractEventDispatcher<EventStreamExchange, DomainEventBus>

Constructors

Link copied to clipboard
constructor(name: String, parallelism: Int, messageBus: DomainEventBus, functionRegistrar: MessageFunctionRegistrar<MessageFunction<Any, DomainEventExchange<*>, Mono<*>>>, eventHandler: EventHandler, schedulerSupplier: AggregateSchedulerSupplier)

Properties

Link copied to clipboard
open override val eventHandler: EventHandler

The event handler for processing events.

Link copied to clipboard

The registrar containing event processing functions.

Link copied to clipboard
open override val messageBus: DomainEventBus

The message bus for sending and receiving events.

Link copied to clipboard
open override val name: String
Link copied to clipboard
open override val namedAggregates: Set<NamedAggregate>

The set of named aggregates that this dispatcher will manage.

Link copied to clipboard
open override val parallelism: Int

The level of parallelism for processing events.

Link copied to clipboard

Functions

Link copied to clipboard
override fun forceStop()

Releases resources promptly without blocking, and remains safe before prepare and across repeated or overlapping calls.

Link copied to clipboard
open override fun newAggregateDispatcher(namedAggregate: NamedAggregate, messageFlux: Flux<EventStreamExchange>): MessageDispatcher

Creates a new message dispatcher for a specific named aggregate.

Link copied to clipboard
override fun prepare(runtimeContext: RuntimeContext): Mono<Void>

Starts the dispatcher by running all aggregate dispatchers.

Link copied to clipboard
override fun quiesce()

Stops admitting new work after the runtime has atomically closed global admission.

Link copied to clipboard
open override fun receiveMessage(subscription: MessageSubscription): Flux<EventStreamExchange>

Creates a flux of messages for the specified subscription.

Link copied to clipboard
override fun start()
Link copied to clipboard
override fun stopGracefully(): Mono<Void>

Stops the dispatcher gracefully by shutting down all aggregate dispatchers.