public final class ComputationScheduler extends Scheduler
Scheduler.Worker| Constructor and Description |
|---|
ComputationScheduler()
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.Worker |
createWorker() |
Disposable |
scheduleDirect(java.lang.Runnable run,
long delay,
java.util.concurrent.TimeUnit unit)
Schedules the given runnable with the given delay directly on a worker of this scheduler.
|
Disposable |
schedulePeriodicallyDirect(java.lang.Runnable run,
long initialDelay,
long period,
java.util.concurrent.TimeUnit unit) |
void |
shutdown() |
void |
start() |
now, scheduleDirectpublic ComputationScheduler()
public Scheduler.Worker createWorker()
createWorker in class Schedulerpublic Disposable scheduleDirect(java.lang.Runnable run, long delay, java.util.concurrent.TimeUnit unit)
SchedulerOverride this method to provide an efficient implementation that, for example, doesn't have extra tracking structures for such one-shot executions.
scheduleDirect in class Schedulerrun - the runnable to scheduledelay - the delay timeunit - the delay unitpublic Disposable schedulePeriodicallyDirect(java.lang.Runnable run, long initialDelay, long period, java.util.concurrent.TimeUnit unit)
schedulePeriodicallyDirect in class Scheduler