A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/util/concurrent/TransferQueue.html below:

TransferQueue (Java SE 15 & JDK 15)

Type Parameters:
E - the type of elements held in this queue
All Superinterfaces:
BlockingQueue<E>, Collection<E>, Iterable<E>, Queue<E>
All Known Implementing Classes:
LinkedTransferQueue
public interface TransferQueue<E>
extends BlockingQueue<E>

A

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(E)

) await receipt of elements by consumers invoking

take

or

poll

, while at other times enqueue elements (via method

put

) without waiting for receipt.

Non-blocking

and

time-out

versions of

tryTransfer

are also available. A

TransferQueue

may also be queried, via

hasWaitingConsumer()

, whether there are any threads waiting for items, which is a converse analogy to a

peek

operation.

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 SynchronousQueue, put and transfer are effectively synonymous.

This interface is a member of the Java Collections Framework.

Since:
1.7

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4