public class DelegatedTaskExecutor<T> extends java.lang.Object implements ITaskExecutor<T>, java.lang.AutoCloseable, java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.Executor |
delegate |
private java.util.concurrent.atomic.AtomicInteger |
flags |
private static org.apache.logging.log4j.Logger |
LOGGER |
private java.lang.String |
name |
ITaskQueue<? super T,? extends java.lang.Runnable> |
queue |
Constructor and Description |
---|
DelegatedTaskExecutor(ITaskQueue<? super T,? extends java.lang.Runnable> queueIn,
java.util.concurrent.Executor delegateIn,
java.lang.String nameIn) |
Modifier and Type | Method and Description |
---|---|
private void |
clearActive() |
void |
close() |
static DelegatedTaskExecutor<java.lang.Runnable> |
create(java.util.concurrent.Executor p_213144_0_,
java.lang.String p_213144_1_) |
private boolean |
driveOne() |
private int |
driveWhile(it.unimi.dsi.fastutil.ints.Int2BooleanFunction p_213145_1_) |
void |
enqueue(T taskIn) |
java.lang.String |
getName() |
private boolean |
isActive() |
private void |
reschedule() |
void |
run() |
private boolean |
setActive() |
private boolean |
shouldSchedule() |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
func_213141_a, inline
private static final org.apache.logging.log4j.Logger LOGGER
private final java.util.concurrent.atomic.AtomicInteger flags
public final ITaskQueue<? super T,? extends java.lang.Runnable> queue
private final java.util.concurrent.Executor delegate
private final java.lang.String name
public DelegatedTaskExecutor(ITaskQueue<? super T,? extends java.lang.Runnable> queueIn, java.util.concurrent.Executor delegateIn, java.lang.String nameIn)
public static DelegatedTaskExecutor<java.lang.Runnable> create(java.util.concurrent.Executor p_213144_0_, java.lang.String p_213144_1_)
private boolean setActive()
private void clearActive()
private boolean shouldSchedule()
public void close()
close
in interface java.lang.AutoCloseable
close
in interface ITaskExecutor<T>
private boolean isActive()
private boolean driveOne()
public void run()
run
in interface java.lang.Runnable
public void enqueue(T taskIn)
enqueue
in interface ITaskExecutor<T>
private void reschedule()
private int driveWhile(it.unimi.dsi.fastutil.ints.Int2BooleanFunction p_213145_1_)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getName()
getName
in interface ITaskExecutor<T>