Package com.gengoai.concurrent
Class Broker<V>
- java.lang.Object
-
- com.gengoai.concurrent.Broker<V>
-
- All Implemented Interfaces:
Serializable
public class Broker<V> extends Object implements Serializable
An implementation of the Producer Consumer problem in which one or more producers are generating data for one or more consumers to process.
- Author:
- David B. Bracewell
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Broker.Builder<V>
A Builder interface for constructing a Broker.static class
Broker.Producer<V>
A producer generates data to be consumed.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <V> Broker.Builder<V>
builder()
Creates a Builder to construct Broker instances.boolean
run()
Starts execution of the broker.
-
-
-
Method Detail
-
builder
public static <V> Broker.Builder<V> builder()
Creates a Builder to construct Broker instances.- Returns:
- A builder instance
-
run
public boolean run()
Starts execution of the broker.- Returns:
- Returns true if the broker completed without interruption, false otherwise
-
-