public interface QueueConsumer<E>
Modifier and Type | Method and Description |
---|---|
E |
cancellablePoll(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 |
cancellableTake()
Retrieves and removes the head of this queue, waiting if necessary until an element becomes
available.
|
<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 |
peek()
Retrieves the head of this queue keeping it in the queue if it is not empty without blocking.
|
E |
poll()
Retrieves and removes the head of this queue if it is not empty without blocking.
|
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()
cancellableTake()
instead.E cancellableTake()
java.util.concurrent.CancellationException
- if surrounding @CancellationScope
is
cancelled while waitingE poll()
null
if the specified waiting time elapses before an
element is availableE peek()
null
if the specified waiting time elapses before an
element is availableE poll(long timeout, java.util.concurrent.TimeUnit unit)
cancellablePoll(long, TimeUnit)
instead.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 availableE cancellablePoll(long timeout, java.util.concurrent.TimeUnit unit)
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.util.concurrent.CancellationException
- if surrounding @CancellationScope
is
cancelled while waiting<R> QueueConsumer<R> map(Functions.Func1<? super E,? extends R> mapper)
mapper
- a non-interfering, stateless function to apply to each element