public interface BlockingQueue4<T> extends Queue4<T>
| Modifier and Type | Method and Description |
|---|---|
int |
drainTo(Collection4<T> list)
Removes all the available elements in the queue to the colletion passed
as argument.
|
T |
next(long timeout)
Returns the next queued item or waits for it to be available for the
maximum of
timeout miliseconds. |
void |
stop() |
T next(long timeout) throws BlockingQueueStoppedException
Returns the next queued item or waits for it to be available for the
maximum of timeout miliseconds.
timeout - maximum time to wait for the next avilable item in milisecondsnull if timeout is
reachedBlockingQueueStoppedException - if the stop() is called.void stop()
int drainTo(Collection4<T> list) throws BlockingQueueStoppedException
Removes all the available elements in the queue to the colletion passed as argument.
It will block until at least one element is available.
list - BlockingQueueStoppedException - if the stop() is called.