public interface Scheduler extends Executor
Scheduler
interface represents a means to execute
a task immediately or after a specified delay. This queues the
task for the requested period of time before it is executed, if a
delay is specified. How the task is executed is dependent on the
implementation, however it will normally use a thread pool.Modifier and Type | Method and Description |
---|---|
void |
execute(Runnable task,
long delay)
This will execute the task within the executor after the time
specified has expired.
|
void |
execute(Runnable task,
long delay,
TimeUnit unit)
This will execute the task within the executor after the time
specified has expired.
|
void execute(Runnable task, long delay)
task
- this is the task to schedule for executiondelay
- the time in milliseconds to wait for executionvoid execute(Runnable task, long delay, TimeUnit unit)
task
- this is the task to schedule for executiondelay
- this is the delay to wait before executionunit
- this is the duration time unit to wait forCopyright © 2023. All rights reserved.