11 |
|
* A {@link BlockingQueue} in which producers may wait for consumers |
12 |
|
* to receive elements. A {@code TransferQueue} may be useful for |
13 |
|
* example in message passing applications in which producers |
14 |
< |
* sometimes (using method {@code transfer}) await receipt of |
15 |
< |
* elements by consumers invoking {@code take} or {@code poll}, |
16 |
< |
* while at other times enqueue elements (via method {@code put}) |
17 |
< |
* without waiting for receipt. Non-blocking and time-out versions of |
18 |
< |
* {@code tryTransfer} are also available. A TransferQueue may also |
19 |
< |
* be queried via {@code hasWaitingConsumer} whether there are any |
20 |
< |
* threads waiting for items, which is a converse analogy to a |
21 |
< |
* {@code peek} operation. |
14 |
> |
* sometimes (using method {@link #transfer}) await receipt of |
15 |
> |
* elements by consumers invoking {@code take} or {@code poll}, while |
16 |
> |
* at other times enqueue elements (via method {@code put}) without |
17 |
> |
* waiting for receipt. {@linkplain |
18 |
> |
* #tryTransfer(Object) Non-blocking} and {@linkplain |
19 |
> |
* #tryTransfer(Object,long,TimeUnit) time-out} versions of {@code |
20 |
> |
* tryTransfer} are also available. A {@code TransferQueue} may also |
21 |
> |
* be queried, via {@link #hasWaitingConsumer}, whether there are any |
22 |
> |
* threads waiting for items, which is a converse analogy to a {@code |
23 |
> |
* peek} operation. |
24 |
|
* |
25 |
< |
* <p>Like any {@code BlockingQueue}, a {@code TransferQueue} may be |
25 |
> |
* <p>Like other blocking queues, a {@code TransferQueue} may be |
26 |
|
* capacity bounded. If so, an attempted {@code transfer} operation |
27 |
|
* may initially block waiting for available space, and/or |
28 |
|
* subsequently block waiting for reception by a consumer. Note that |