Package net.minecraft.util
Class PendingTaskRunner
java.lang.Object
net.minecraft.util.PendingTaskRunner
A runner for tasks that can hold only one pending task. It replaces the
current pending task if a new one is queued, but does not halt already
running tasks.
The runner needs to be updated by tick(), which checks if
the running task is done and polls the pending task. queue(net.minecraft.util.PendingTaskRunner.FutureRunnable)
sets the pending task for running.
- Mappings:
Namespace Name official rhintermediary net/minecraft/class_7493named net/minecraft/util/PendingTaskRunner
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA supplier of a running task. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicReference<PendingTaskRunner.FutureRunnable>private @Nullable CompletableFuture<?> -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
pending
- Mappings:
Namespace Name Mixin selector official aLrh;a:Ljava/util/concurrent/atomic/AtomicReference;intermediary field_39442Lnet/minecraft/class_7493;field_39442:Ljava/util/concurrent/atomic/AtomicReference;named pendingLnet/minecraft/util/PendingTaskRunner;pending:Ljava/util/concurrent/atomic/AtomicReference;
-
running
- Mappings:
Namespace Name Mixin selector official bLrh;b:Ljava/util/concurrent/CompletableFuture;intermediary field_39443Lnet/minecraft/class_7493;field_39443:Ljava/util/concurrent/CompletableFuture;named runningLnet/minecraft/util/PendingTaskRunner;running:Ljava/util/concurrent/CompletableFuture;
-
-
Constructor Details
-
PendingTaskRunner
public PendingTaskRunner()
-
-
Method Details
-
tick
public void tick()Waits for the running task to finish and polls the pending task if there is no running task.- Mappings:
Namespace Name Mixin selector official aLrh;a()Vintermediary method_44122Lnet/minecraft/class_7493;method_44122()Vnamed tickLnet/minecraft/util/PendingTaskRunner;tick()V
-
poll
private void poll()- Mappings:
Namespace Name Mixin selector official bLrh;b()Vintermediary method_44307Lnet/minecraft/class_7493;method_44307()Vnamed pollLnet/minecraft/util/PendingTaskRunner;poll()V
-
queue
Queues a task for running, and replaces any existing pending task.- API Note:
- This method can be called asynchronously, such as from the netty event loop.
- Mappings:
Namespace Name Mixin selector official aLrh;a(Lrh$a;)Vintermediary method_44306Lnet/minecraft/class_7493;method_44306(Lnet/minecraft/class_7493$class_7518;)Vnamed queueLnet/minecraft/util/PendingTaskRunner;queue(Lnet/minecraft/util/PendingTaskRunner$FutureRunnable;)V
-