Interface AsyncExecutor

All Superinterfaces:
Executor, TaskExecutor, TickAdapter
All Known Implementing Classes:
SimpleAsyncExecutor

public interface AsyncExecutor extends TaskExecutor
Represents an async task executor.
  • Method Details

    • submit

      default <V> CompletableFuture<@PolyNull V> submit(Supplier<@PolyNull V> task, int ticks)
      Description copied from interface: TaskExecutor
      Submit a task.
      Specified by:
      submit in interface TaskExecutor
      Type Parameters:
      V - the type of result the task returns
      Parameters:
      task - the task to submit
      ticks - the delay before the task is executed in game ticks
      Returns:
      the scheduled task as a future
    • repeat

      default Task repeat(Runnable task, int ticks, int periodTicks)
      Description copied from interface: TaskExecutor
      Schedule a repeating task.
      Specified by:
      repeat in interface TaskExecutor
      Parameters:
      task - the task to schedule
      ticks - the delay before the first task execution in game ticks
      periodTicks - how often to repeat the task in game ticks
      Returns:
      the scheduled task