public final class CachedThreadScheduler extends Scheduler implements SchedulerLifecycle
Scheduler.Worker
Constructor and Description |
---|
CachedThreadScheduler(ThreadFactory threadFactory) |
Modifier and Type | Method and Description |
---|---|
Scheduler.Worker |
createWorker()
Retrieves or creates a new
Scheduler.Worker that represents serial execution of actions. |
void |
shutdown()
Instructs the Scheduler instance to stop threads
and stop accepting tasks on any outstanding Workers.
|
void |
start()
Allows the Scheduler instance to start threads
and accept tasks on them.
|
public CachedThreadScheduler(ThreadFactory threadFactory)
public void start()
SchedulerLifecycle
Implementations should make sure the call is idempotent and thread-safe.
start
in interface SchedulerLifecycle
public void shutdown()
SchedulerLifecycle
Implementations should make sure the call is idempotent and thread-safe.
shutdown
in interface SchedulerLifecycle
public Scheduler.Worker createWorker()
Scheduler
Scheduler.Worker
that represents serial execution of actions.
When work is completed it should be unsubscribed using Subscription.unsubscribe()
.
Work on a Scheduler.Worker
is guaranteed to be sequential.
createWorker
in class Scheduler
Copyright © 2018. All rights reserved.