public interface QueueConsumer<E>
Modifier and Type | Method and Description |
---|---|
<R> QueueConsumer<R> |
map(Functions.Func1<? super E,? extends R> mapper)
Returns a queue consisting of the results of applying the given function to the elements of
this queue.
|
E |
poll(long timeout,
java.util.concurrent.TimeUnit unit)
Retrieves and removes the head of this queue, waiting up to the specified wait time if
necessary for an element to become available.
|
E |
take()
Retrieves and removes the head of this queue, waiting if necessary until an element becomes
available.
|
E take() throws java.lang.InterruptedException
java.lang.InterruptedException
- if interrupted while waitingE poll(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
timeout
- how long to wait before giving up, in units of unit
unit
- a TimeUnit
determining how to interpret the timeout
parameternull
if the specified waiting time elapses before an
element is availablejava.lang.InterruptedException
- if interrupted while waiting<R> QueueConsumer<R> map(Functions.Func1<? super E,? extends R> mapper)
mapper
- a non-interfering, stateless function to apply to each element