@Deprecated
public class TimerWheel
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
class |
TimerWheel.Timer
Deprecated.
|
static class |
TimerWheel.TimerState
Deprecated.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
INITIAL_TICK_DEPTH
Deprecated.
|
| Constructor and Description |
|---|
TimerWheel(long tickDuration,
java.util.concurrent.TimeUnit timeUnit,
int ticksPerWheel)
Deprecated.
Construct a timer wheel for use in scheduling timers.
|
TimerWheel(NanoClock clock,
long tickDuration,
java.util.concurrent.TimeUnit timeUnit,
int ticksPerWheel)
Deprecated.
Construct a timer wheel for use in scheduling timers.
|
| Modifier and Type | Method and Description |
|---|---|
NanoClock |
clock()
Deprecated.
Get the
NanoClock used by this timer wheel. |
long |
computeDelayInMs()
Deprecated.
Compute delay in milliseconds until next tick.
|
int |
expireTimers()
Deprecated.
Process timers and execute any expired timers.
|
TimerWheel.Timer |
newBlankTimer()
Deprecated.
Return a blank
TimerWheel.Timer suitable for rescheduling. |
TimerWheel.Timer |
newTimeout(long delay,
java.util.concurrent.TimeUnit unit,
java.lang.Runnable task)
Deprecated.
Schedule a new timer that runs
task when it expires. |
void |
rescheduleTimeout(long delay,
java.util.concurrent.TimeUnit unit,
TimerWheel.Timer timer)
Deprecated.
Reschedule an expired timer, reusing the
TimerWheel.Timer object. |
void |
rescheduleTimeout(long delay,
java.util.concurrent.TimeUnit unit,
TimerWheel.Timer timer,
java.lang.Runnable task)
Deprecated.
Reschedule an expired timer, reusing the
TimerWheel.Timer object. |
java.lang.Iterable<TimerWheel.Timer> |
scheduled()
Deprecated.
Return
Iterable<Timer> with scheduled but not yet executed timers. |
public static final int INITIAL_TICK_DEPTH
public TimerWheel(long tickDuration,
java.util.concurrent.TimeUnit timeUnit,
int ticksPerWheel)
tickDuration - of each tick of the wheeltimeUnit - for the tick durationticksPerWheel - of the wheel. Must be a power of 2.public TimerWheel(NanoClock clock, long tickDuration, java.util.concurrent.TimeUnit timeUnit, int ticksPerWheel)
This constructor allows a custom function to return the current time instead of System.nanoTime().
clock - to use for system timetickDuration - of each tick of the wheeltimeUnit - for the tick durationticksPerWheel - of the wheel. Must be a power of 2.public NanoClock clock()
NanoClock used by this timer wheel.NanoClock used by this timer wheel.public TimerWheel.Timer newBlankTimer()
TimerWheel.Timer suitable for rescheduling.
NOTE: Appears to be a cancelled timer
public TimerWheel.Timer newTimeout(long delay, java.util.concurrent.TimeUnit unit, java.lang.Runnable task)
task when it expires.delay - until timer should expireunit - of time for delaytask - to execute when timer expiresTimerWheel.Timer for timerpublic void rescheduleTimeout(long delay,
java.util.concurrent.TimeUnit unit,
TimerWheel.Timer timer)
TimerWheel.Timer object.delay - until timer should expireunit - of time for delaytimer - to reschedulejava.lang.IllegalArgumentException - if timer is activepublic void rescheduleTimeout(long delay,
java.util.concurrent.TimeUnit unit,
TimerWheel.Timer timer,
java.lang.Runnable task)
TimerWheel.Timer object.delay - until timer should expireunit - of time for delaytimer - to rescheduletask - to execute when timer expiresjava.lang.IllegalArgumentException - if timer is activepublic long computeDelayInMs()
public int expireTimers()
public java.lang.Iterable<TimerWheel.Timer> scheduled()
Iterable<Timer> with scheduled but not yet executed timers.
This timers could be in TimerWheel.TimerState.ACTIVE or TimerWheel.TimerState.EXPIRED states.Iterable<Timer> with scheduled but not yet executed timersCopyright © 2014 - 2016 Real Logic Ltd. All Rights Reserved.