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.Executor
dispatcher
private static org.apache.logging.log4j.Logger
LOGGER
private java.lang.String
name
ITaskQueue<? super T,? extends java.lang.Runnable>
queue
private java.util.concurrent.atomic.AtomicInteger
status
-
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 boolean
canBeScheduled()
void
close()
static DelegatedTaskExecutor<java.lang.Runnable>
create(java.util.concurrent.Executor p_213144_0_, java.lang.String p_213144_1_)
java.lang.String
name()
private boolean
pollTask()
private int
pollUntil(it.unimi.dsi.fastutil.ints.Int2BooleanFunction p_213145_1_)
private void
registerForExecution()
void
run()
private void
setAsIdle()
private boolean
setAsScheduled()
private boolean
shouldProcess()
void
tell(T p_212871_1_)
java.lang.String
toString()
-
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:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceITaskExecutor<T>
-
shouldProcess
private boolean shouldProcess()
-
pollTask
private boolean pollTask()
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
-
tell
public void tell(T p_212871_1_)
- Specified by:
tell
in 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:
toString
in classjava.lang.Object
-
name
public java.lang.String name()
- Specified by:
name
in interfaceITaskExecutor<T>
-
-