public abstract class ThreadTaskExecutor<R extends java.lang.Runnable> extends java.lang.Object implements ITaskExecutor<R>, java.util.concurrent.Executor
Modifier and Type | Field and Description |
---|---|
private int |
drivers |
private static org.apache.logging.log4j.Logger |
LOGGER |
private java.lang.String |
name |
private java.util.Queue<R> |
queue |
Modifier | Constructor and Description |
---|---|
protected |
ThreadTaskExecutor(java.lang.String nameIn) |
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
canRun(R runnable) |
java.util.concurrent.CompletableFuture<java.lang.Void> |
deferTask(java.lang.Runnable taskIn) |
protected void |
drainTasks() |
protected boolean |
driveOne() |
void |
driveUntil(java.util.function.BooleanSupplier isDone) |
protected void |
dropTasks() |
void |
enqueue(R taskIn) |
void |
execute(java.lang.Runnable p_execute_1_) |
protected abstract java.lang.Thread |
getExecutionThread() |
java.lang.String |
getName() |
int |
getQueueSize() |
boolean |
isOnExecutionThread() |
protected void |
run(R taskIn) |
java.util.concurrent.CompletableFuture<java.lang.Void> |
runAsync(java.lang.Runnable taskIn) |
void |
runImmediately(java.lang.Runnable taskIn) |
protected boolean |
shouldDeferTasks() |
<V> java.util.concurrent.CompletableFuture<V> |
supplyAsync(java.util.function.Supplier<V> supplier) |
protected void |
threadYieldPark() |
protected abstract R |
wrapTask(java.lang.Runnable runnable) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, func_213141_a, inline
private final java.lang.String name
private static final org.apache.logging.log4j.Logger LOGGER
private final java.util.Queue<R extends java.lang.Runnable> queue
private int drivers
protected abstract R wrapTask(java.lang.Runnable runnable)
protected abstract boolean canRun(R runnable)
public boolean isOnExecutionThread()
protected abstract java.lang.Thread getExecutionThread()
protected boolean shouldDeferTasks()
public int getQueueSize()
public java.lang.String getName()
getName
in interface ITaskExecutor<R extends java.lang.Runnable>
public <V> java.util.concurrent.CompletableFuture<V> supplyAsync(java.util.function.Supplier<V> supplier)
public java.util.concurrent.CompletableFuture<java.lang.Void> deferTask(java.lang.Runnable taskIn)
public java.util.concurrent.CompletableFuture<java.lang.Void> runAsync(java.lang.Runnable taskIn)
public void runImmediately(java.lang.Runnable taskIn)
public void enqueue(R taskIn)
enqueue
in interface ITaskExecutor<R extends java.lang.Runnable>
public void execute(java.lang.Runnable p_execute_1_)
execute
in interface java.util.concurrent.Executor
protected void dropTasks()
protected void drainTasks()
protected boolean driveOne()
public void driveUntil(java.util.function.BooleanSupplier isDone)
protected void threadYieldPark()
protected void run(R taskIn)