Interface SyncExecutor

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

public interface SyncExecutor extends TaskExecutor
Represents a sync task executor.
  • Method Details

    • submit

      default <V> CompletableFuture<@PolyNull V> submit(Supplier<@PolyNull V> task, long delay, TimeUnit unit)
      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
      delay - the delay before the task is executed
      unit - the unit of time for delay
      Returns:
      the scheduled task as a future
    • repeat

      default Task repeat(Runnable task, int periodTicks)
      Description copied from interface: TaskExecutor
      Schedule a repeating task.
      Specified by:
      repeat in interface TaskExecutor
      Parameters:
      task - the task to schedule
      periodTicks - how often to repeat the task in game ticks
      Returns:
      the scheduled task
    • 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
    • repeat

      default Task repeat(Runnable task, long delay, long period, TimeUnit unit)
      Description copied from interface: TaskExecutor
      Schedule a repeating task.
      Specified by:
      repeat in interface TaskExecutor
      Parameters:
      task - the task to schedule
      delay - the delay before the first task execution
      period - how often to repeat the task
      unit - the unit of time for delay and period
      Returns:
      the scheduled task
    • repeat

      default Task repeat(Consumer<? super Task> task, int periodTicks)
      Schedule a repeating task.
      Parameters:
      task - the task to schedule
      periodTicks - how often to repeat the task in game ticks
      Returns:
      the scheduled task
    • repeat

      default Task repeat(Consumer<? super Task> task, long period, TimeUnit unit)
      Schedule a repeating task.
      Parameters:
      task - the task to schedule
      period - how often to repeat the task
      unit - the unit of time for period
      Returns:
      the scheduled task
    • repeat

      default Task repeat(Consumer<? super Task> task, long delay, long period, TimeUnit unit)
      Schedule a repeating task.
      Parameters:
      task - the task to schedule
      delay - the delay before the first task execution
      period - how often to repeat the task
      unit - the unit of time for delay and period
      Returns:
      the scheduled task
    • repeat

      Task repeat(Consumer<? super Task> task, int ticks, int periodTicks)
      Schedule a repeating task.
      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
    • clear

      void clear()
      Clear all scheduled tasks in this executor without shutting down.