- All Superinterfaces:
Executor,TaskExecutor,TickAdapter
- All Known Implementing Classes:
AbstractSyncExecutor
Represents a sync task executor.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear all scheduled tasks in this executor without shutting down.default TaskSchedule a repeating task.default TaskSchedule a repeating task.default TaskSchedule a repeating task.default TaskSchedule a repeating task.Schedule a repeating task.default TaskSchedule a repeating task.default TaskSchedule a repeating task.default <V> CompletableFuture<@PolyNull V>Submit a task.Methods inherited from interface me.moros.tasker.executor.TaskExecutor
execute, isValid, repeat, shutdown, submit, submit, submit, submit, submitMethods inherited from interface me.moros.tasker.executor.TickAdapter
convert, toMillis, toTicks
-
Method Details
-
submit
default <V> CompletableFuture<@PolyNull V> submit(Supplier<@PolyNull V> task, long delay, TimeUnit unit) 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 submitdelay- the delay before the task is executedunit- the unit of time for delay- Returns:
- the scheduled task as a future
-
repeat
Description copied from interface:TaskExecutorSchedule a repeating task.- Specified by:
repeatin interfaceTaskExecutor- Parameters:
task- the task to scheduleperiodTicks- how often to repeat the task in game ticks- Returns:
- the scheduled task
-
repeat
Description copied from interface:TaskExecutorSchedule a repeating task.- Specified by:
repeatin interfaceTaskExecutor- Parameters:
task- 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
-
repeat
Description copied from interface:TaskExecutorSchedule a repeating task.- Specified by:
repeatin interfaceTaskExecutor- Parameters:
task- the task to scheduledelay- the delay before the first task executionperiod- how often to repeat the taskunit- the unit of time for delay and period- Returns:
- the scheduled task
-
repeat
Schedule a repeating task.- Parameters:
task- the task to scheduleperiodTicks- how often to repeat the task in game ticks- Returns:
- the scheduled task
-
repeat
Schedule a repeating task.- Parameters:
task- the task to scheduleperiod- how often to repeat the taskunit- the unit of time for period- Returns:
- the scheduled task
-
repeat
Schedule a repeating task.- Parameters:
task- the task to scheduledelay- the delay before the first task executionperiod- how often to repeat the taskunit- the unit of time for delay and period- Returns:
- the scheduled task
-
repeat
Schedule a repeating task.- Parameters:
task- 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
void clear()Clear all scheduled tasks in this executor without shutting down.
-