DefaultAggregateSchedulerSupplier

class DefaultAggregateSchedulerSupplier(val name: String, val parallelism: Int = Schedulers.DEFAULT_POOL_SIZE) : AggregateSchedulerSupplier, ParallelismCapable, Named

Default implementation of AggregateSchedulerSupplier that creates dedicated schedulers for each aggregate.

This implementation maintains a cache of schedulers, creating a new parallel scheduler for each unique aggregate on first access. Subsequent requests for the same aggregate return the cached scheduler, ensuring consistent thread allocation and resource reuse.

The scheduler names follow the pattern "{supplier-name}-{aggregate-name}" for easy identification in thread dumps and monitoring tools.

See also

Schedulers.newParallel

Constructors

Link copied to clipboard
constructor(name: String, parallelism: Int = Schedulers.DEFAULT_POOL_SIZE)

Properties

Link copied to clipboard
open override val name: String

the name of this scheduler supplier, used as a prefix for scheduler names

Link copied to clipboard
open override val parallelism: Int

Functions

Link copied to clipboard
open override fun close()

Closes this resource by performing a graceful shutdown.

Link copied to clipboard
open override fun getOrInitialize(namedAggregate: NamedAggregate): Scheduler

Gets the cached scheduler for the aggregate or creates a new parallel scheduler.

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 all schedulers gracefully.