java.lang.Object
me.moros.tasker.executor.AbstractSyncExecutor
- All Implemented Interfaces:
Executor,SyncExecutor,TaskExecutor,TickAdapter
An abstract sync executor utilizing that delegates to a
TimerWheel.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidfinal voidclear()Clear all scheduled tasks in this executor without shutting down.Schedule a repeating task.voidshutdown()Safely shutdown this executor.<V> CompletableFuture<@PolyNull V>Submit a task.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.moros.tasker.executor.SyncExecutor
repeat, repeat, repeat, repeat, repeat, repeat, submitMethods inherited from interface me.moros.tasker.executor.TaskExecutor
execute, isValid, repeat, submit, submit, submit, submitMethods inherited from interface me.moros.tasker.executor.TickAdapter
convert, toMillis, toTicks
-
Field Details
-
wheel
-
-
Constructor Details
-
AbstractSyncExecutor
-
AbstractSyncExecutor
protected AbstractSyncExecutor()
-
-
Method Details
-
submit
Description copied from interface:TaskExecutorSubmit a task.- Specified by:
submitin interfaceTaskExecutor- Type Parameters:
V- the type of result the task returns- Parameters:
task- the task to submitticks- the delay before the task is executed in game ticks- Returns:
- the scheduled task as a future
-
repeat
Description copied from interface:SyncExecutorSchedule a repeating task.- Specified by:
repeatin interfaceSyncExecutor- Parameters:
consumer- the task to scheduleticks- the delay before the first task execution in game ticksperiodTicks- how often to repeat the task in game ticks- Returns:
- the scheduled task
-
clear
public final void clear()Description copied from interface:SyncExecutorClear all scheduled tasks in this executor without shutting down.- Specified by:
clearin interfaceSyncExecutor
-
shutdown
public void shutdown()Description copied from interface:TaskExecutorSafely shutdown this executor.- Specified by:
shutdownin interfaceTaskExecutor
-
checkValid
protected void checkValid()
-