public static interface Schedulers.Factory
Modifier and Type | Method and Description |
---|---|
default ScheduledExecutorService |
decorateExecutorService(String schedulerType,
Supplier<? extends ScheduledExecutorService> actual)
Deprecated.
use
Schedulers.addExecutorServiceDecorator(String, BiFunction) and
Schedulers.removeExecutorServiceDecorator(String) instead, to compose
multiple decorators in addition to the one from the current
Factory |
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. |
@Deprecated default ScheduledExecutorService decorateExecutorService(String schedulerType, Supplier<? extends ScheduledExecutorService> actual)
Schedulers.addExecutorServiceDecorator(String, BiFunction)
and
Schedulers.removeExecutorServiceDecorator(String)
instead, to compose
multiple decorators in addition to the one from the current
Factory
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.Worker
threadFactory
- 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 Thread
Scheduler
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 Scheduler
Scheduler
that hosts a single worker