java.lang.Object | |
↳ | com.rabbitmq.utility.BlockingCell<T> |
Known Direct Subclasses
|
Simple one-shot IPC mechanism. Essentially a one-place buffer that cannot be emptied once filled.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Instantiate a new BlockingCell waiting for a value of the specified type.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Wait for a value, and when one arrives, return it (without clearing it).
| |||||||||||
Wait for a value, and when one arrives, return it (without clearing it).
| |||||||||||
Store a value in this BlockingCell, throwing AssertionError if the cell already has a value.
| |||||||||||
Store a value in this BlockingCell if it doesn't already have a value.
| |||||||||||
As get(), but catches and ignores InterruptedException, retrying until a value appears.
| |||||||||||
As get(long timeout), but catches and ignores InterruptedException, retrying until
a value appears or until specified timeout is reached.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Instantiate a new BlockingCell waiting for a value of the specified type.
Wait for a value, and when one arrives, return it (without clearing it). If there's already a value present, there's no need to wait - the existing value is returned. If timeout is reached and value hasn't arrived, TimeoutException is thrown.
timeout | timeout in milliseconds. -1 effectively means infinity |
---|
InterruptedException | if this thread is interrupted |
---|---|
TimeoutException |
Wait for a value, and when one arrives, return it (without clearing it). If there's already a value present, there's no need to wait - the existing value is returned.
InterruptedException | if this thread is interrupted |
---|
Store a value in this BlockingCell, throwing AssertionError if the cell already has a value.
newValue | the new value to store |
---|
Store a value in this BlockingCell if it doesn't already have a value.
newValue | the new value to store |
---|
As get(), but catches and ignores InterruptedException, retrying until a value appears.
As get(long timeout), but catches and ignores InterruptedException, retrying until a value appears or until specified timeout is reached. If timeout is reached, TimeoutException is thrown. We also use System.nanoTime() to behave correctly when system clock jumps around.
timeout | timeout in milliseconds. -1 means 'infinity': never time out |
---|
TimeoutException |
---|