public static interface Schedulers.Factory
Modifier and Type | Method and Description |
---|---|
default Scheduler |
newElastic(int ttlSeconds,
java.util.concurrent.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,
java.util.concurrent.ThreadFactory threadFactory)
Scheduler that hosts a fixed pool of workers and is suited for parallel
work. |
default Scheduler |
newSingle(java.util.concurrent.ThreadFactory threadFactory)
Scheduler that hosts a single worker and is suited for non-blocking
work. |
default TimedScheduler |
newTimer(java.util.concurrent.ThreadFactory threadFactory)
Create a new
TimedScheduler backed by a dedicated resource. |
default Scheduler newElastic(int ttlSeconds, java.util.concurrent.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, java.util.concurrent.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(java.util.concurrent.ThreadFactory threadFactory)
Scheduler
that hosts a single worker and is suited for non-blocking
work.default TimedScheduler newTimer(java.util.concurrent.ThreadFactory threadFactory)
TimedScheduler
backed by a dedicated resource.threadFactory
- a ThreadFactory
to use for the eventual threadTimedScheduler