Interface Scheduler

All Known Implementing Classes:
AbstractMainThreadBasedScheduler, SchedulerExecutorPoolImpl, SchedulerReference, SchedulerSameThreadImpl

public interface Scheduler
Scheduler is used to run the commands, tasks, etc.
  • Method Details

    • run

      Runs the supplier in the specified thread
      Parameters:
      type - the thread type
      runnable - the runnable to run
      Returns:
      the supplier result
    • runLater

      default CompletableFuture<Void> runLater(SchedulerType type, Duration delay, ThrowingRunnable<Throwable> runnable)
      Runs the supplier in the specified thread after the specified delay
      Parameters:
      type - the thread type
      delay - the delay
      runnable - the runnable to run
      Returns:
      the supplier result
    • supply

      default <T> CompletableFuture<T> supply(SchedulerType type, ThrowingSupplier<T,Throwable> supplier)
      Runs the supplier in the specified thread
      Type Parameters:
      T - the supplier return type
      Parameters:
      type - the thread type
      supplier - the supplier to run
      Returns:
      the supplier result
    • supplyLater

      <T> CompletableFuture<T> supplyLater(SchedulerType type, Duration delay, ThrowingSupplier<T,Throwable> supplier)
      Runs the supplier in the specified thread after the specified delay
      Type Parameters:
      T - the supplier return type
      Parameters:
      type - the thread type
      delay - the delay
      supplier - the supplier to run
      Returns:
      the supplier result
    • shutdown

      void shutdown()