Class SchedulerManager

All Implemented Interfaces:

public final class SchedulerManager extends Object implements Scheduler
  • Constructor Details

    • SchedulerManager

      public SchedulerManager()
  • Method Details

    • process

      public void process()
      Description copied from interface: Scheduler
      Process scheduled tasks based on time to increase scheduling precision.

      This method is not thread-safe.

      Specified by:
      process in interface Scheduler
    • processTick

      public void processTick()
      Description copied from interface: Scheduler
      Advance 1 tick and call Scheduler.process().

      This method is not thread-safe.

      Specified by:
      processTick in interface Scheduler
    • submitTask

      @NotNull public @NotNull Task submitTask(@NotNull @NotNull Supplier<TaskSchedule> task, @NotNull @NotNull ExecutionType executionType)
      Description copied from interface: Scheduler
      Submits a new task with custom scheduling logic.

      This is the primitive method used by all scheduling shortcuts, task is immediately executed in the caller thread to retrieve its scheduling state and the task will stay alive as long as TaskSchedule.stop() is not returned (or Task.cancel() is called).

      Specified by:
      submitTask in interface Scheduler
      task - the task to be directly executed in the caller thread
      executionType - the execution type
      the created task
    • shutdown

      public void shutdown()
    • buildShutdownTask

      public void buildShutdownTask(@NotNull @NotNull Runnable runnable)