An ExecutionStrategy executes Runnable tasks produced by a Producer.
The strategy to execute the task may vary depending on the implementation; the task may be
run in the calling thread, or in a new thread, etc.
The strategy delegates the production of tasks to a Producer, and continues to
execute tasks until the producer continues to produce them.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | ExecutionStrategy.Producer
A producer of |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void |
| dispatch | back to summary |
|---|---|
| public void dispatch() 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)
| |
| produce | back to summary |
|---|---|
| public void produce() Initiates (or resumes) the task production and consumption. The produced task may be run by the same thread that called this method.
| |
A producer of Runnable tasks to run.
The ExecutionStrategy will repeatedly invoke produce() until
the producer returns null, indicating that it has nothing more to produce.
When no more tasks can be produced, implementations should arrange for the
ExecutionStrategy to be invoked again in case an external event resumes
the tasks production.
| Modifier and Type | Method and Description |
|---|---|
| public Runnable | Returns: a task to executed or null if there are no more tasks to executeProduces a task to be executed. |
| produce | back to summary |
|---|---|
| public Runnable produce() Produces a task to be executed.
| |