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.
  • Method Summary

    Modifier and Type
    Method
    Description
    default Task.Builder
    buildTask(@NotNull Runnable task)
    Creates a new task builder.
    static @NotNull Scheduler
    Internal factory method for creating a new scheduler instance.
    @NotNull Task
    Submits a task to be executed at a later time or repeatedly.

    Methods inherited from interface Closeable

    close
  • Method Details

    • newScheduler

      @Internal @NotNull static @NotNull Scheduler newScheduler()

      Internal factory method for creating a new scheduler instance.

      This method should only be used internally and should not be accessed directly by external users of the API.

      Returns:
      A new instance of SchedulerImpl.
    • 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