public interface Scheduler extends Disposable
ScheduledExecutorService
Modifier and Type | Method and Description |
---|---|
Disposable |
schedule(Runnable command,
long delay,
TimeUnit unit)
Creates and executes a one-shot action that becomes enabled after the given delay.
|
Disposable |
scheduleAtFixedRate(Runnable command,
long initialDelay,
long period,
TimeUnit unit)
Creates and executes a periodic action that becomes enabled first after the given initial delay,
and subsequently with the given period; that is executions will commence after initialDelay
then initialDelay+period, then initialDelay + 2 * period, and so on.
|
Disposable |
scheduleWithFixedDelay(Runnable command,
long initialDelay,
long delay,
TimeUnit unit)
Creates and executes a periodic action that becomes enabled first
after the given initial delay, and subsequently with the
given delay between the termination of one execution and the
commencement of the next.
|
dispose
Disposable schedule(Runnable command, long delay, TimeUnit unit)
command
- the task to executedelay
- the time from now to delay executionunit
- the time unit of the delay parameterDisposable scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit)
command
- the task to executeinitialDelay
- the time to delay first executiondelay
- the delay between the termination of one
execution and the commencement of the nextunit
- the time unit of the initialDelay and delay parametersDisposable scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)
command
- the task to executeinitialDelay
- the time to delay first executionperiod
- the delayunit
- the time unit of the initialDelay and delay parametersCopyright © 2017. All Rights Reserved.