public class TaskExecutor<T> extends Object implements MessageListener<T>, AutoCloseable, Runnable
Modifier and Type | Field and Description |
---|---|
private Executor |
executor |
private static Logger |
LOGGER |
private String |
name |
TaskQueue<? super T,? extends Runnable> |
queue |
private AtomicInteger |
stateFlags |
Constructor and Description |
---|
TaskExecutor(TaskQueue<? super T,? extends Runnable> queue,
Executor executor,
String name) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
static TaskExecutor<Runnable> |
create(Executor executor,
String name) |
private void |
execute() |
String |
getName() |
private boolean |
hasMessages() |
private boolean |
isUnpaused() |
private void |
pause() |
void |
run() |
private boolean |
runNext() |
private int |
runWhile(it.unimi.dsi.fastutil.ints.Int2BooleanFunction condition) |
void |
send(T message) |
String |
toString() |
private boolean |
unpause() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
ask, create, method_27918
private static final Logger LOGGER
private final AtomicInteger stateFlags
private final Executor executor
private final String name
public static TaskExecutor<Runnable> create(Executor executor, String name)
private boolean unpause()
private void pause()
private boolean hasMessages()
public void close()
close
in interface AutoCloseable
close
in interface MessageListener<T>
private boolean isUnpaused()
private boolean runNext()
public void send(T message)
send
in interface MessageListener<T>
private void execute()
private int runWhile(it.unimi.dsi.fastutil.ints.Int2BooleanFunction condition)
public String getName()
getName
in interface MessageListener<T>