Package com.tick42.glue.core
Interface Scheduler
public interface Scheduler
Abstract boundary for asynchronous task scheduling and execution.
- Since:
- 1.1
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic Schedulerof(ScheduledExecutorService executor) ReturnSchedulerwhich uses backingScheduledExecutorServiceto schedule tasks for asynchronous execution.static Schedulerdefault AsynchronousCloseableSchedules a specified task for execution as soon as possible.Schedules a specified task for execution after specified delay.default AsynchronousCloseableSchedules a specified task for execution after specified delay.
-
Method Details
-
schedule
Schedules a specified task for execution after specified delay.- Parameters:
action- action to executedelay- delay amountunit- delay unit- Returns:
AsynchronousCloseableused to cancel execution, nevernull
-
schedule
Schedules a specified task for execution as soon as possible.- Parameters:
action- action to execute- Returns:
AsynchronousCloseableused to cancel execution, nevernull
-
schedule
Schedules a specified task for execution after specified delay.- Parameters:
action- action to executedelay- delay- Returns:
AsynchronousCloseableused to cancel execution, nevernull
-
of
ReturnSchedulerwhich uses backingScheduledExecutorServiceto schedule tasks for asynchronous execution.- Parameters:
executor- an executor- Returns:
- new scheduler, never
null
-
of
- Parameters:
timer- a timer- Returns:
- new scheduler, never
null
-