Package net.minecraft.util.concurrent
Class DelegatedTaskExecutor<T>
- java.lang.Object
-
- net.minecraft.util.concurrent.DelegatedTaskExecutor<T>
-
- All Implemented Interfaces:
java.lang.AutoCloseable,java.lang.Runnable,ITaskExecutor<T>
public class DelegatedTaskExecutor<T> extends java.lang.Object implements ITaskExecutor<T>, java.lang.AutoCloseable, java.lang.Runnable
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.Executordispatcherprivate static org.apache.logging.log4j.LoggerLOGGERprivate java.lang.StringnameITaskQueue<? super T,? extends java.lang.Runnable>queueprivate java.util.concurrent.atomic.AtomicIntegerstatus
-
Constructor Summary
Constructors Constructor Description DelegatedTaskExecutor(ITaskQueue<? super T,? extends java.lang.Runnable> p_i50402_1_, java.util.concurrent.Executor p_i50402_2_, java.lang.String p_i50402_3_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleancanBeScheduled()voidclose()static DelegatedTaskExecutor<java.lang.Runnable>create(java.util.concurrent.Executor p_213144_0_, java.lang.String p_213144_1_)java.lang.Stringname()private booleanpollTask()private intpollUntil(it.unimi.dsi.fastutil.ints.Int2BooleanFunction p_213145_1_)private voidregisterForExecution()voidrun()private voidsetAsIdle()private booleansetAsScheduled()private booleanshouldProcess()voidtell(T p_212871_1_)java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.minecraft.util.concurrent.ITaskExecutor
ask, askEither
-
-
-
-
Field Detail
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER
-
status
private final java.util.concurrent.atomic.AtomicInteger status
-
queue
public final ITaskQueue<? super T,? extends java.lang.Runnable> queue
-
dispatcher
private final java.util.concurrent.Executor dispatcher
-
name
private final java.lang.String name
-
-
Constructor Detail
-
DelegatedTaskExecutor
public DelegatedTaskExecutor(ITaskQueue<? super T,? extends java.lang.Runnable> p_i50402_1_, java.util.concurrent.Executor p_i50402_2_, java.lang.String p_i50402_3_)
-
-
Method Detail
-
create
public static DelegatedTaskExecutor<java.lang.Runnable> create(java.util.concurrent.Executor p_213144_0_, java.lang.String p_213144_1_)
-
setAsScheduled
private boolean setAsScheduled()
-
setAsIdle
private void setAsIdle()
-
canBeScheduled
private boolean canBeScheduled()
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceITaskExecutor<T>
-
shouldProcess
private boolean shouldProcess()
-
pollTask
private boolean pollTask()
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
tell
public void tell(T p_212871_1_)
- Specified by:
tellin interfaceITaskExecutor<T>
-
registerForExecution
private void registerForExecution()
-
pollUntil
private int pollUntil(it.unimi.dsi.fastutil.ints.Int2BooleanFunction p_213145_1_)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
name
public java.lang.String name()
- Specified by:
namein interfaceITaskExecutor<T>
-
-