public static interface Schedulers.Factory
|Modifier and Type||Method and Description|
@Deprecated default Scheduler newElastic(int ttlSeconds, ThreadFactory threadFactory)
newBoundedElastic(int, int, ThreadFactory, int), to be removed in 3.5.0
Schedulerthat dynamically creates Workers resources and caches eventually, reusing them once the Workers have been shut down.
The maximum number of created workers is unbounded.
default Scheduler newBoundedElastic(int threadCap, int queuedTaskCap, ThreadFactory threadFactory, int ttlSeconds)
Schedulerthat dynamically creates a bounded number of ExecutorService-based Workers, reusing them once the Workers have been shut down. The underlying (user or daemon) threads can be evicted if idle for more than
The maximum number of created thread pools is bounded by the provided
threadCap- maximum number of underlying threads to create
queuedTaskCap- maximum number of tasks to enqueue when no more threads can be created. Can be
Integer.MAX_VALUEfor unbounded enqueueing.
ThreadFactoryto use each thread initialization
ttlSeconds- Time-to-live for an idle
Schedulerthat dynamically creates workers with an upper bound to the number of backing threads, reuses threads and evict idle ones
default Scheduler newParallel(int parallelism, ThreadFactory threadFactory)
Schedulerthat hosts a fixed pool of workers and is suited for parallel work.