public class ProduceConsume extends Object implements ExecutionStrategy, Runnable
A strategy where the caller thread iterates over task production, submitting each
task to an Executor for execution.
| Modifier and Type | Class and Description |
|---|---|
static class |
ProduceConsume.Factory |
ExecutionStrategy.DefaultExecutionStrategyFactory, ExecutionStrategy.Producer, ExecutionStrategy.Rejectable| Constructor and Description |
|---|
ProduceConsume(ExecutionStrategy.Producer producer,
Executor executor) |
| Modifier and Type | Method and Description |
|---|---|
void |
dispatch()
Initiates (or resumes) the task production and execution.
|
void |
execute()
Initiates (or resumes) the task production and execution.
|
void |
run() |
public ProduceConsume(ExecutionStrategy.Producer producer, Executor executor)
public void execute()
ExecutionStrategyInitiates (or resumes) the task production and execution.
The produced task may be run by the same thread that called this method.
execute in interface ExecutionStrategyExecutionStrategy.dispatch()public void dispatch()
ExecutionStrategyInitiates (or resumes) the task production and execution.
This method guarantees that the task is never run by the thread that called this method.
dispatch in interface ExecutionStrategyExecutionStrategy.execute()Copyright © 1995-2016 Webtide. All Rights Reserved.