public class EventLoopsScheduler extends Schedulerimplements SchedulerLifecycle
Scheduler.Worker | Constructor and Description |
|---|
EventLoopsScheduler()
Create a scheduler with pool size equal to the available processor count and using least-recent worker selection policy.
|
| Modifier and Type | Method and Description |
|---|---|
Scheduler |
createWorker()
Retrieves or creates a new
Scheduler.Worker that represents serial execution of actions.
|
Subscription |
scheduleDirect(Action0
Schedules the action directly on one of the event loop workers without the additional infrastructure and checking.
|
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 EventLoopsScheduler()
public Scheduler.Worker createWorker()
Scheduler
Scheduler.Worker that represents serial execution of actions.
When work is completed it should be unsubscribed using Subscription.
Work on a Scheduler.Worker is guaranteed to be sequential.
createWorker in class
Scheduler
public void start()
SchedulerLifecycle
Implementations should make sure the call is idempotent and threadsafe.
public void shutdown()
SchedulerLifecycle
Implementations should make sure the call is idempotent and threadsafe.
public SubscriptionscheduleDirect(Action0 action)
action - the action to schedule