BlockingQueue in which producers may wait for consumers
to receive elements. A
TransferQueue may be useful for
example in message passing applications in which producers
sometimes (using method
transfer) await receipt of
elements by consumers invoking
at other times enqueue elements (via method
waiting for receipt.
time-out versions of
tryTransfer are also available.
TransferQueue may also be queried, via
hasWaitingConsumer, whether there are any threads waiting for
items, which is a converse analogy to a
Like other blocking queues, a
TransferQueue may be
capacity bounded. If so, an attempted transfer operation may
initially block waiting for available space, and/or subsequently
block waiting for reception by a consumer. Note that in a queue
with zero capacity, such as
transfer are effectively synonymous.
This interface is a member of the Java Collections Framework.
|the type of elements held in this collection|