public interface Timer
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancel this timer by interrupting the task thread.
|
long |
getResolution()
Get the resolution of this tTimer.
|
Pausable |
schedule(Consumer<java.lang.Long> consumer,
long period,
java.util.concurrent.TimeUnit timeUnit)
Schedule a recurring task.
|
Pausable |
schedule(Consumer<java.lang.Long> consumer,
long period,
java.util.concurrent.TimeUnit timeUnit,
long delayInMilliseconds)
Schedule a recurring task.
|
Pausable |
submit(Consumer<java.lang.Long> consumer)
Submit a task for arbitrary execution after the delay of this timer's resolution.
|
Pausable |
submit(Consumer<java.lang.Long> consumer,
long delay,
java.util.concurrent.TimeUnit timeUnit)
Submit a task for arbitrary execution after the given time delay.
|
long getResolution()
Pausable schedule(Consumer<java.lang.Long> consumer, long period, java.util.concurrent.TimeUnit timeUnit, long delayInMilliseconds)
Consumer will be invoked once every N time units
after the given delay.consumer - the Consumer to invoke each periodperiod - the amount of time that should elapse between invocations of the given ConsumertimeUnit - the unit of time the period is to be measured indelayInMilliseconds - a number of milliseconds in which to delay any execution of the given ConsumerPausable that can be used to cancel, pause or
resume the given task.Pausable schedule(Consumer<java.lang.Long> consumer, long period, java.util.concurrent.TimeUnit timeUnit)
Consumer will be invoked immediately, as well as
once
every N time units.consumer - the Consumer to invoke each periodperiod - the amount of time that should elapse between invocations of the given ConsumertimeUnit - the unit of time the period is to be measured inPausable that can be used to cancel, pause or
resume the given task.schedule(reactor.fn.Consumer, long, java.util.concurrent.TimeUnit, long)Pausable submit(Consumer<java.lang.Long> consumer, long delay, java.util.concurrent.TimeUnit timeUnit)
Pausable submit(Consumer<java.lang.Long> consumer)
consumer - the Consumer to invokevoid cancel()