EDU.oswego.cs.dl.util.concurrent
public interface Takable
Full method descriptions appear in the Channel interface.
[ Introduction to this package. ]
See Also: Channel
Method Summary | |
---|---|
Object | poll(long msecs)
Return and remove an item from channel only if one is available within
msecs milliseconds. |
Object | take()
Return and remove an item from channel,
possibly waiting indefinitely until
such an item exists. |
Parameters: 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.
Returns: some item, or null if the channel is empty.
Throws: 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).
Returns: some item from the channel. Different implementations may guarantee various properties (such as FIFO) about that item
Throws: 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.