public abstract class Scheduler
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Scheduler.Worker |
| Constructor and Description |
|---|
Scheduler() |
| Modifier and Type | Method and Description |
|---|---|
abstract Scheduler.Worker |
createWorker() |
long |
now(java.util.concurrent.TimeUnit unit)
Returns the 'current time' of the Scheduler in the specified time unit.
|
Disposable |
scheduleDirect(java.lang.Runnable run) |
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() |
public abstract Scheduler.Worker createWorker()
public long now(java.util.concurrent.TimeUnit unit)
unit - the time unitpublic void start()
public void shutdown()
public Disposable scheduleDirect(java.lang.Runnable run)
public Disposable scheduleDirect(java.lang.Runnable run, long delay, java.util.concurrent.TimeUnit unit)
Override this method to provide an efficient implementation that, for example, doesn't have extra tracking structures for such one-shot executions.
run - 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)