1. Introduction
The linked list based unbounded BlockingQueue, provided by FIFO and jdk7, inherits from TransferQueue, which inherits from BlockingQueue, so has its own unique characteristics.
2. TransferQueue interface
If the producer waits for the consumer to receive the element, it can use the TransferQueue. The producer calling the Transfer method will receive the credentials when the consumer calls the take or poll method to get the element, but the producer using the PUT method will not.
1. TryTransfer (E) : send elements to consumers immediately. If there is no consumer, it will return false instead of putting the element on the queue.
2. Transfer (E) : Transfer elements to consumers. If there are no consumers, they will wait.
3. TryTransfer (E,long,TimeUnit) : Give the element to the consumer immediately, if not, wait for the specified time. Return false for failure.
4. HasWaitingConsumer () : Returns whether there is currently a consumer waiting element.
5. GetWaitingConsumerCount () : returns the number of consumers in the waiting for the element