Interface Scheduler

All Superinterfaces:
AutoCloseable, Closeable

public interface Scheduler extends Closeable
Represents a scheduler that can be used to schedule tasks to be executed at a later time.

This interface provides methods to schedule tasks to be executed at a later time.
This interface is by default implemented by the SchedulerImpl class.

See Also:
  • SchedulerImpl
  • Method Details

    • newScheduler

      @NotNull static @NotNull Scheduler newScheduler()
      Creates a new scheduler.
      Returns:
      a new scheduler
    • buildTask

      @NotNull default Task.Builder buildTask(@NotNull @NotNull Runnable task)
      Creates a new task builder.
      Parameters:
      task - the task to be executed
      Returns:
      a new task builder
    • submitTask

      @NotNull @NotNull Task submitTask(@NotNull Task.Builder builder)
      Submits a task to be executed at a later time or repeatedly.
      Parameters:
      builder - the task builder
      Returns:
      the submitted task