Package net.minecraftforge.fml
Class 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.
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate static final org.apache.logging.log4j.Loggerprivate final ModLoadingStageprivate final ConcurrentLinkedDeque<DeferredWorkQueue.TaskInfo> private static final Map<ModLoadingStage, DeferredWorkQueue> 
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprivate static <T> TcaptureException(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 voidmakeRunnable(DeferredWorkQueue.TaskInfo ti, Executor executor, RuntimeException aggregate) voidrunTasks()
- 
Field Details- 
LOGGERprivate static final org.apache.logging.log4j.Logger LOGGER
- 
workQueues
- 
tasks
- 
modLoadingStage
 
- 
- 
Constructor Details- 
DeferredWorkQueue
 
- 
- 
Method Details- 
lookup
- 
runTaskspublic void runTasks()
- 
makeRunnableprivate static void makeRunnable(DeferredWorkQueue.TaskInfo ti, Executor executor, RuntimeException aggregate) 
- 
captureExceptionprivate static <T> T captureException(String modId, RuntimeException aggregate, Throwable throwable) 
- 
enqueueWork
- 
enqueueWork
- 
enqueueWorkprivate <T> CompletableFuture<T> enqueueWork(ModContainer modInfo, Function<DeferredWorkQueue.TaskInfo, CompletableFuture<T>> futureGen) 
 
-