public static interface Schedulers.Factory
| Modifier and Type | Method and Description |
|---|---|
default ScheduledExecutorService |
decorateExecutorService(String schedulerType,
Supplier<? extends ScheduledExecutorService> actual)
Override this method to decorate
ScheduledExecutorService internally used by
Reactor's various Scheduler implementations, allowing to tune the
ScheduledExecutorService backing implementation. |
default Scheduler |
newElastic(int ttlSeconds,
ThreadFactory threadFactory)
Scheduler that dynamically creates Workers resources and caches
eventually, reusing them once the Workers have been shut down. |
default Scheduler |
newParallel(int parallelism,
ThreadFactory threadFactory)
Scheduler that hosts a fixed pool of workers and is suited for parallel
work. |
default Scheduler |
newSingle(ThreadFactory threadFactory)
Scheduler that hosts a single worker and is suited for non-blocking
work. |
default ScheduledExecutorService decorateExecutorService(String schedulerType, Supplier<? extends ScheduledExecutorService> actual)
ScheduledExecutorService internally used by
Reactor's various Scheduler implementations, allowing to tune the
ScheduledExecutorService backing implementation.schedulerType - a name hinting at the flavor of Scheduler being tuned.actual - the default backing implementation, provided lazily as a Supplier
so that you can bypass instantiation completely if you want to replace it.ScheduledExecutorService instance to use.default Scheduler newElastic(int ttlSeconds, ThreadFactory threadFactory)
Scheduler that dynamically creates Workers resources and caches
eventually, reusing them once the Workers have been shut down.
The maximum number of created workers is unbounded.
ttlSeconds - Time-to-live for an idle Scheduler.WorkerthreadFactory - a ThreadFactory to useScheduler that dynamically creates Workers resources and
caches eventually, reusing them once the Workers have been shut down.default Scheduler newParallel(int parallelism, ThreadFactory threadFactory)
Scheduler that hosts a fixed pool of workers and is suited for parallel
work.parallelism - Number of pooled workers.threadFactory - a ThreadFactory to use for the fixed initialized
number of ThreadScheduler that hosts a fixed pool of workers and is
suited for parallel workdefault Scheduler newSingle(ThreadFactory threadFactory)
Scheduler that hosts a single worker and is suited for non-blocking
work.threadFactory - a ThreadFactory to use for the unique resource of
the SchedulerScheduler that hosts a single worker