@Deprecated
public class DeferredWorkQueue
extends java.lang.Object
Use of this class after startup is not possible. At that
point, IThreadListener
should be used instead.
Exceptions from tasks will be handled gracefully, causing a mod loading error. Tasks that take egregiously long times to run will be logged. This is being deprecated in favour of a new interface on loading events, to remove confusion about how it operates. #TODO
修飾子とタイプ | クラスと説明 |
---|---|
static interface |
DeferredWorkQueue.CheckedRunnable
非推奨です。
Runnable except it allows throwing checked exceptions. |
コンストラクタと説明 |
---|
DeferredWorkQueue()
非推奨です。
|
修飾子とタイプ | メソッドと説明 |
---|---|
static <T> java.util.concurrent.CompletableFuture<T> |
getLater(java.util.function.Supplier<T> workToEnqueue)
非推奨です。
Run a task computing a result on the loading thread at the next available
opportunity, i.e. after the current lifecycle event has completed.
|
static <T> java.util.concurrent.CompletableFuture<T> |
getLaterChecked(java.util.concurrent.Callable<T> workToEnqueue)
非推奨です。
Run a task computing a result on the loading thread at the next available
opportunity, i.e. after the current lifecycle event has completed.
|
static java.util.concurrent.CompletableFuture<java.lang.Void> |
runLater(java.lang.Runnable workToEnqueue)
非推奨です。
Run a task on the loading thread at the next available opportunity, i.e.
|
static java.util.concurrent.CompletableFuture<java.lang.Void> |
runLaterChecked(DeferredWorkQueue.CheckedRunnable workToEnqueue)
非推奨です。
Run a task on the loading thread at the next available opportunity, i.e.
|
public static java.util.concurrent.CompletableFuture<java.lang.Void> runLater(java.lang.Runnable workToEnqueue)
If the task must throw a checked exception, use
runLaterChecked(CheckedRunnable)
.
If the task has a result, use getLater(Supplier)
or
getLaterChecked(Callable)
.
workToEnqueue
- A Runnable
to execute later, on the loading
threadCompletableFuture
that completes at said timepublic static java.util.concurrent.CompletableFuture<java.lang.Void> runLaterChecked(DeferredWorkQueue.CheckedRunnable workToEnqueue)
If the task does not throw a checked exception, use
runLater(Runnable)
.
If the task has a result, use getLater(Supplier)
or
getLaterChecked(Callable)
.
workToEnqueue
- A DeferredWorkQueue.CheckedRunnable
to execute later, on the
loading threadCompletableFuture
that completes at said timepublic static <T> java.util.concurrent.CompletableFuture<T> getLater(java.util.function.Supplier<T> workToEnqueue)
If the task throws a checked exception, use
getLaterChecked(Callable)
.
If the task does not have a result, use runLater(Runnable)
or
runLaterChecked(CheckedRunnable)
.
T
- The result type of the taskworkToEnqueue
- A Supplier
to execute later, on the loading
threadCompletableFuture
that completes at said timepublic static <T> java.util.concurrent.CompletableFuture<T> getLaterChecked(java.util.concurrent.Callable<T> workToEnqueue)
If the task does not throw a checked exception, use
#getLater(Callable)
.
If the task does not have a result, use runLater(Runnable)
or
runLaterChecked(CheckedRunnable)
.
T
- The result type of the taskworkToEnqueue
- A Supplier
to execute later, on the loading
threadCompletableFuture
that completes at said time