public interface Takable
Full method descriptions appear in the Channel interface.
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
poll(long msecs)
Return and remove an item from channel only if one is available within
msecs milliseconds.
|
java.lang.Object |
take()
Return and remove an item from channel,
possibly waiting indefinitely until
such an item exists.
|
java.lang.Object take() throws java.lang.InterruptedException
java.lang.InterruptedException
- if the current thread has
been interrupted at a point at which interruption
is detected, in which case state of the channel is unchanged.java.lang.Object poll(long msecs) throws java.lang.InterruptedException
msecs
- the number of milliseconds to wait. If less than
or equal to zero, the operation does not perform any timed waits,
but might still require
access to a synchronization lock, which can impose unbounded
delay if there is a lot of contention for the channel.java.lang.InterruptedException
- if the current thread has
been interrupted at a point at which interruption
is detected, in which case state of the channel is unchanged
(i.e., equivalent to a false return).Copyright © 2002-2025. All Rights Reserved.