Class SchedulerThreadPool

java.lang.Object
ca.spottedleaf.concurrentutil.scheduler.SchedulerThreadPool

@Deprecated public class SchedulerThreadPool extends Object
Deprecated.
To be replaced
  • Field Details

    • DEADLINE_NOT_SET

      public static final long DEADLINE_NOT_SET
      Deprecated.
      See Also:
  • Constructor Details

    • SchedulerThreadPool

      public SchedulerThreadPool(int threads, ThreadFactory threadFactory)
      Deprecated.
      Creates, but does not start, a scheduler thread pool with the specified number of threads created using the specified thread factory.
      Parameters:
      threads - Specified number of threads
      threadFactory - Specified thread factory
      See Also:
  • Method Details

    • start

      public void start()
      Deprecated.
      Starts the threads in this pool.
    • halt

      public boolean halt(boolean sync, long maxWaitNS)
      Deprecated.
      Attempts to prevent further execution of tasks, optionally waiting for the scheduler threads to die.
      Parameters:
      sync - Whether to wait for the scheduler threads to die.
      maxWaitNS - The maximum time, in ns, to wait for the scheduler threads to die.
      Returns:
      true if sync was false, or if sync was true and the scheduler threads died before the timeout. Otherwise, returns false if the time elapsed exceeded the maximum wait time.
    • getThreads

      public Thread[] getThreads()
      Deprecated.
      Returns an array of the underlying scheduling threads.
    • schedule

      public void schedule(SchedulerThreadPool.SchedulableTick task)
      Deprecated.
      Schedules the specified task to be executed on this thread pool.
      Parameters:
      task - Specified task
      Throws:
      IllegalStateException - If the task is already scheduled
      See Also:
    • updateTickStartToMax

      public boolean updateTickStartToMax(SchedulerThreadPool.SchedulableTick task, long newStart)
      Deprecated.
      Updates the tasks scheduled start to the maximum of its current scheduled start and the specified new start. If the task is not scheduled, returns false. Otherwise, returns whether the scheduled start was updated. Undefined behavior of the specified task is scheduled in another executor.
      Parameters:
      task - Specified task
      newStart - Specified new start
    • tryRetire

      Deprecated.
      Returns null if the task is not scheduled, returns TRUE if the task was cancelled and was queued to execute, returns FALSE if the task was cancelled but was executing.
    • notifyTasks

      public void notifyTasks(SchedulerThreadPool.SchedulableTick task)
      Deprecated.
      Indicates that intermediate tasks are available to be executed by the task.

      Note: currently a no-op

      Parameters:
      task - The specified task
      See Also: