Package com.xxl.tool.concurrent
Class TimeWheel
java.lang.Object
com.xxl.tool.concurrent.TimeWheel
time wheel
- Author:
- xuxueli 2025-04-18
-
Constructor Summary
ConstructorsConstructorDescriptionTimeWheel(int ticksCount, long tickDuration) TimeWheel(int ticksCount, long tickDuration, int taskExecutorCoreSize, int taskExecutorMaxSize, int taskExecutorQueueSize) TimeWheel(int ticksCount, long tickDuration, ExecutorService taskExecutor) constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidstart()start time wheelvoidstop()stop time wheelbooleansubmitTask(long executeTime, Runnable task) submit task
-
Constructor Details
-
TimeWheel
public TimeWheel(int ticksCount, long tickDuration) -
TimeWheel
public TimeWheel(int ticksCount, long tickDuration, int taskExecutorCoreSize, int taskExecutorMaxSize, int taskExecutorQueueSize) -
TimeWheel
constructor- Parameters:
ticksCount- ticks counttickDuration- tick duration, by millisecond
-
-
Method Details
-
start
public void start()start time wheel -
stop
public void stop()stop time wheel -
submitTask
submit task- Parameters:
executeTime-task-- Returns:
-