Package org.jbrew.concurrent
Class UnboundedTaskQueue
java.lang.Object
org.jbrew.concurrent.AbstractBlockingTaskQueue
org.jbrew.concurrent.UnboundedTaskQueue
public class UnboundedTaskQueue extends AbstractBlockingTaskQueue
A
BoundedTaskQueue
is an unordered, unbounded implementation of a TaskQueue
.
This implementation is ThreadSafe
, as it can safely handle multiple consumer
and producer threads writing and/or reading from it.- Author:
- nealk
-
Field Summary
-
Constructor Summary
Constructors Constructor Description UnboundedTaskQueue()
-
Method Summary
-
Constructor Details
-
UnboundedTaskQueue
public UnboundedTaskQueue()
-
-
Method Details
-
enqueue
Description copied from interface:TaskQueue
Adds an element to the head of the queue. When the queue is full (bounded implementations only), the callingThread
is blocked until capacity in the queue has been released.- Parameters:
task
- - TheTask
which is being added to the queue.- Throws:
java.lang.InterruptedException
- - The method hands off the responsibility of exception handling to the caller in event of an interruption in theThread
.
-