-
- All Known Implementing Classes:
HashedWheelTimer
public interface TimerSchedulesTimerTasks for one-time future execution in a background thread.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TimeoutnewTimeout(TimerTask task, long delay, TimeUnit unit)Schedules the specifiedTimerTaskfor one-time execution after the specified delay.Set<Timeout>stop()Releases all resources acquired by thisTimerand cancels all tasks which were scheduled but not executed yet.
-
-
-
Method Detail
-
newTimeout
Timeout newTimeout(TimerTask task, long delay, TimeUnit unit)
Schedules the specifiedTimerTaskfor one-time execution after the specified delay.- Returns:
- a handle which is associated with the specified task
- Throws:
IllegalStateException- if this timer has been stopped alreadyRejectedExecutionException- if the pending timeouts are too many and creating new timeout can cause instability in the system.
-
-