Class SchedulerThreadPool
java.lang.Object
ca.spottedleaf.concurrentutil.scheduler.SchedulerThreadPool
Deprecated.
To be replaced
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated.To be replaced -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSchedulerThreadPool(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. -
Method Summary
Modifier and TypeMethodDescriptionThread[]Deprecated.Returns an array of the underlying scheduling threads.booleanhalt(boolean sync, long maxWaitNS) Deprecated.Attempts to prevent further execution of tasks, optionally waiting for the scheduler threads to die.voidDeprecated.Indicates that intermediate tasks are available to be executed by the task.voidDeprecated.Schedules the specified task to be executed on this thread pool.voidstart()Deprecated.Starts the threads in this pool.Deprecated.Returnsnullif the task is not scheduled, returnsTRUEif the task was cancelled and was queued to execute, returnsFALSEif the task was cancelled but was executing.booleanupdateTickStartToMax(SchedulerThreadPool.SchedulableTick task, long newStart) Deprecated.Updates the tasks scheduled start to the maximum of its current scheduled start and the specified new start.
-
Field Details
-
DEADLINE_NOT_SET
public static final long DEADLINE_NOT_SETDeprecated.- See Also:
-
-
Constructor Details
-
SchedulerThreadPool
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 threadsthreadFactory- 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:
trueif sync was false, or if sync was true and the scheduler threads died before the timeout. Otherwise, returnsfalseif the time elapsed exceeded the maximum wait time.
-
getThreads
Deprecated.Returns an array of the underlying scheduling threads. -
schedule
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
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, returnsfalse. Otherwise, returns whether the scheduled start was updated. Undefined behavior of the specified task is scheduled in another executor.- Parameters:
task- Specified tasknewStart- Specified new start
-
tryRetire
Deprecated.Returnsnullif the task is not scheduled, returnsTRUEif the task was cancelled and was queued to execute, returnsFALSEif the task was cancelled but was executing. -
notifyTasks
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:
-