-
- All Implemented Interfaces:
-
com.tds.common.reactor.schedulers.SchedulerLifecycle
public final class CachedThreadScheduler extends Scheduler implements SchedulerLifecycle
-
-
Constructor Summary
Constructors Constructor Description CachedThreadScheduler(ThreadFactory threadFactory)
-
Method Summary
Modifier and Type Method Description void
start()
Allows the Scheduler instance to start threadsand accept tasks on them. void
shutdown()
Instructs the Scheduler instance to stop threadsand stop accepting tasks on any outstanding Workers. Scheduler.Worker
createWorker()
Retrieves or creates a new Scheduler.Worker that represents serial execution of actions. -
-
Constructor Detail
-
CachedThreadScheduler
CachedThreadScheduler(ThreadFactory threadFactory)
-
-
Method Detail
-
start
void start()
Allows the Scheduler instance to start threadsand accept tasks on them.
Implementations should make sure the call is idempotent and thread-safe.
-
shutdown
void shutdown()
Instructs the Scheduler instance to stop threadsand stop accepting tasks on any outstanding Workers.
Implementations should make sure the call is idempotent and thread-safe.
-
createWorker
Scheduler.Worker createWorker()
Retrieves or creates a new Scheduler.Worker that represents serial execution of actions.
When work is completed it should be unsubscribed using unsubscribe.
Work on a Scheduler.Worker is guaranteed to be sequential.
-
-
-
-