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