Package com.semedy.reasoner.utils
Class Consumer<T>
java.lang.Object
com.semedy.reasoner.utils.Consumer<T>
Provides producer consumer functionality.
Here we have separate threads for consumers.
The producer is the main thread and queues the produced
products using method produced
Here we have separate threads for consumers.
The producer is the main thread and queues the produced
products using method produced
- Author:
- Juergen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Queue produced productvoid
Indicate consumers that production has been finishedvoid
start()
-
Constructor Details
-
Consumer
Create consumer threads.
queueCapacity is the capacity of the queue
for queueing products.- Parameters:
queueCapacity
-
-
-
Method Details
-
start
public void start() -
productionFinished
Indicate consumers that production has been finished- Throws:
InterruptedException
-
produced
Queue produced product- Parameters:
product
-- Throws:
InterruptedException
-