SnapshotDispatcher

class SnapshotDispatcher(val name: String, val namedAggregates: Set<NamedAggregate> = MetadataSearcher.namedAggregateType.keys.toSet(), snapshotHandler: SnapshotHandler, stateEventBus: StateEventBus, parallelism: Int = MessageParallelism.DEFAULT_PARALLELISM, schedulerSupplier: AggregateSchedulerSupplier = DefaultAggregateSchedulerSupplier(SNAPSHOT_PROCESSOR_NAME)) : MainDispatcher<StateEventExchange<*>>

Constructors

Link copied to clipboard
constructor(name: String, namedAggregates: Set<NamedAggregate> = MetadataSearcher.namedAggregateType.keys.toSet(), snapshotHandler: SnapshotHandler, stateEventBus: StateEventBus, parallelism: Int = MessageParallelism.DEFAULT_PARALLELISM, schedulerSupplier: AggregateSchedulerSupplier = DefaultAggregateSchedulerSupplier(SNAPSHOT_PROCESSOR_NAME))

Properties

Link copied to clipboard
open override val name: String

named like applicationName.SnapshotDispatcher

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

The set of named aggregates that this dispatcher will manage.

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.