Package io.aeron.cluster
Class WheelTimerServiceSupplier
java.lang.Object
io.aeron.cluster.WheelTimerServiceSupplier
- All Implemented Interfaces:
TimerServiceSupplier
Supplies an instance of a
WheelTimerService based on the configuration given to the constructor.-
Constructor Summary
ConstructorsConstructorDescriptionWheelTimerServiceSupplier(TimeUnit timeUnit, long startTime, long tickResolution, int ticksPerWheel) Construct the supplier with the necessary parameters to configure the timer wheel. -
Method Summary
Modifier and TypeMethodDescriptionnewInstance(TimeUnit clusterTimeUnit, TimerService.TimerHandler timerHandler) New instance of theTimerService.
-
Constructor Details
-
WheelTimerServiceSupplier
public WheelTimerServiceSupplier(TimeUnit timeUnit, long startTime, long tickResolution, int ticksPerWheel) Construct the supplier with the necessary parameters to configure the timer wheel.- Parameters:
timeUnit- for the values used to express the time. This time unit is used to denote the supplied time values. When the instance is constructed it will use this to convert the suppliedstartTimeandtickResolutioninto the time unit that is being used by the cluster clock.startTime- for the wheel (in givenTimeUnit).tickResolution- for the wheel, i.e. how manyTimeUnits per tick.ticksPerWheel- or spokes, for the wheel (must be power of 2).
-
-
Method Details
-
newInstance
New instance of theTimerService.- Specified by:
newInstancein interfaceTimerServiceSupplier- Parameters:
clusterTimeUnit- units to be used by the underlying timer service.timerHandler- that must be invoked for each expired timer.- Returns:
- timer service instance ready for immediate usage.
-