StateEventDispatcher

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

Constructors

Link copied to clipboard
constructor(name: String, parallelism: Int, messageBus: StateEventBus, 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: StateEventBus

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
open override fun close()

Closes this resource by performing a graceful shutdown.

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

Creates a new message dispatcher for a specific named aggregate.

Link copied to clipboard
open override fun receiveMessage(namedAggregate: NamedAggregate): Flux<StateEventExchange<*>>

Creates a flux of messages for the specified named aggregate.

Link copied to clipboard
open override fun start()

Starts the dispatcher by running all aggregate dispatchers.

Link copied to clipboard
open fun stop()

Synchronously closes this resource with graceful shutdown.

open fun stop(timeout: Duration)

Synchronously closes this resource with graceful shutdown within a specified timeout.

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

Stops the dispatcher gracefully by shutting down all aggregate dispatchers.