public class ProduceExecuteConsume extends java.lang.Object implements ExecutionStrategy
A strategy where the caller thread iterates over task production, submitting each
task to an Executor
for execution.
Modifier and Type | Class and Description |
---|---|
private static class |
ProduceExecuteConsume.State |
ExecutionStrategy.Producer
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.Executor |
_executor |
private Locker |
_locker |
private ExecutionStrategy.Producer |
_producer |
private ProduceExecuteConsume.State |
_state |
private static Logger |
LOG |
Constructor and Description |
---|
ProduceExecuteConsume(ExecutionStrategy.Producer producer,
java.util.concurrent.Executor executor) |
Modifier and Type | Method and Description |
---|---|
void |
dispatch()
Initiates (or resumes) the task production and consumption.
|
void |
produce()
Initiates (or resumes) the task production and consumption.
|
private static final Logger LOG
private final Locker _locker
private final ExecutionStrategy.Producer _producer
private final java.util.concurrent.Executor _executor
private ProduceExecuteConsume.State _state
public ProduceExecuteConsume(ExecutionStrategy.Producer producer, java.util.concurrent.Executor executor)
public void produce()
ExecutionStrategy
Initiates (or resumes) the task production and consumption.
The produced task may be run by the same thread that called this method.
produce
in interface ExecutionStrategy
ExecutionStrategy.dispatch()
public void dispatch()
ExecutionStrategy
Initiates (or resumes) the task production and consumption.
This method guarantees that the task is never run by the thread that called this method.
TODO review the need for this (only used by HTTP2 push)dispatch
in interface ExecutionStrategy
ExecutionStrategy.produce()