[concurrency-interest] New method for BlockingQueue

Jean Morissette jean.morissette666@videotron.ca
Fri, 29 Oct 2004 00:08:48 -0400

I would like to use a method in BlockingQueue that blocks on the queue 
up until a timeout occurs or until an element appears on the queue, 
returning all elements waiting on the queue at that time.

It's a little bit like a mix of methods poll(long timeout, TimeUnit 
unit) and drainTo(Collection c), thus something like drainTo(Collection 
c, long timeout, TimeUnit unit).

I don't think that there is a way to implements efficiently this method 
by wrapping a BlockingQueue.  Am-I wrong?

Is it possible that this method could be added in a future release?