public interface Scheduler
Modifier and Type | Method and Description |
---|---|
Task |
execute(java.lang.Runnable runnable)
Executes the given runnable asynchronously.
|
Task |
schedule(java.lang.Runnable runnable,
long delay,
java.util.concurrent.TimeUnit timeUnit)
Schedules the given runnable to be executed asynchronously after the given delay.
|
Task |
scheduleRepeating(java.lang.Runnable runnable,
long delay,
long period,
java.util.concurrent.TimeUnit timeUnit)
Schedules the given runnable to be executed asynchronously after a delay and then repeatedly with a period.
|
void |
shutdown()
Shuts down the scheduler and awaits task termination.
|
Task execute(java.lang.Runnable runnable)
runnable
- runnable to executeTask schedule(java.lang.Runnable runnable, long delay, java.util.concurrent.TimeUnit timeUnit)
runnable
- runnable to executedelay
- delay before executiontimeUnit
- time unit of the delayTask scheduleRepeating(java.lang.Runnable runnable, long delay, long period, java.util.concurrent.TimeUnit timeUnit)
runnable
- runnable to executedelay
- delay before executionperiod
- period between executionstimeUnit
- time unit of the delay and periodvoid shutdown()