类 DeferredWorkQueue
java.lang.Object
net.minecraftforge.fml.DeferredWorkQueue
Utility for running code on the main launch thread at the next available
opportunity. There is no guaranteed order that work from various mods will be
run, but your own work will be run sequentially.
Use of this class after startup is not possible. At that
point, ReentrantBlockableEventLoop
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.
-
嵌套类概要
嵌套类 -
字段概要
字段修饰符和类型字段说明private static final org.apache.logging.log4j.Logger
private final ModLoadingStage
private final ConcurrentLinkedDeque
<DeferredWorkQueue.TaskInfo> private static final Map
<ModLoadingStage, DeferredWorkQueue> -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明private static <T> T
captureException
(String modId, RuntimeException aggregate, Throwable throwable) enqueueWork
(ModContainer modInfo, Runnable work) private <T> CompletableFuture
<T> enqueueWork
(ModContainer modInfo, Function<DeferredWorkQueue.TaskInfo, CompletableFuture<T>> futureGen) <T> CompletableFuture
<T> enqueueWork
(ModContainer modInfo, Supplier<T> work) static Optional
<DeferredWorkQueue> lookup
(Optional<ModLoadingStage> parallelClass) private static void
makeRunnable
(DeferredWorkQueue.TaskInfo ti, Executor executor, RuntimeException aggregate) void
runTasks()
-
字段详细资料
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
workQueues
-
tasks
-
modLoadingStage
-
-
构造器详细资料
-
DeferredWorkQueue
-
-
方法详细资料
-
lookup
-
runTasks
public void runTasks() -
makeRunnable
private static void makeRunnable(DeferredWorkQueue.TaskInfo ti, Executor executor, RuntimeException aggregate) -
captureException
private static <T> T captureException(String modId, RuntimeException aggregate, Throwable throwable) -
enqueueWork
-
enqueueWork
-
enqueueWork
private <T> CompletableFuture<T> enqueueWork(ModContainer modInfo, Function<DeferredWorkQueue.TaskInfo, CompletableFuture<T>> futureGen)
-