public interface Pollable<E>
Modifier and Type | Method and Description |
---|---|
E |
poll()
Removes and returns the next element, or returns
null if none is present. |
E |
poll(long timeout,
TimeUnit unit)
Removes and returns the next element, or returns
null upon timeout. |
E poll()
null
if none is present.E poll(long timeout, TimeUnit unit) throws InterruptedException
null
upon timeout.timeout
- how long to wait before giving up, in units of
unit
unit
- a TimeUnit
determining how to interpret the
timeout
parameterInterruptedException
- if interrupted while waiting