C# Class RabbitMQ.Util.BlockingCell

A thread-safe single-assignment reference cell.
A fresh BlockingCell holds no value (is empty). Any thread reading the Value property when the cell is empty will block until a value is made available by some other thread. The Value property can only be set once - on the first call, the BlockingCell is considered full, and made immutable. Further attempts to set Value result in a thrown InvalidOperationException.
显示文件 Open project: ru-sh/rabbitmq-dotnet-client Class Usage Examples

Public Methods

Method Description
GetValue ( System.TimeSpan timeout ) : object

Retrieve the cell's value, waiting for the given timeout if no value is immediately available.

If a value is present in the cell at the time the call is made, the call will return immediately. Otherwise, the calling thread blocks until either a value appears, or operation times out.

If no value was available before the timeout, an exception is thrown.

GetValue ( int timeout ) : object

Retrieve the cell's value, waiting for the given timeout if no value is immediately available.

If a value is present in the cell at the time the call is made, the call will return immediately. Otherwise, the calling thread blocks until either a value appears, or operation times out.

If no value was available before the timeout, an exception is thrown.

validatedTimeout ( int timeout ) : int

Return valid timeout value

If value of the parameter is less then zero, return 0 to mean infinity

Method Details

GetValue() public method

Retrieve the cell's value, waiting for the given timeout if no value is immediately available.

If a value is present in the cell at the time the call is made, the call will return immediately. Otherwise, the calling thread blocks until either a value appears, or operation times out.

If no value was available before the timeout, an exception is thrown.

public GetValue ( System.TimeSpan timeout ) : object
timeout System.TimeSpan
return object

GetValue() public method

Retrieve the cell's value, waiting for the given timeout if no value is immediately available.

If a value is present in the cell at the time the call is made, the call will return immediately. Otherwise, the calling thread blocks until either a value appears, or operation times out.

If no value was available before the timeout, an exception is thrown.

public GetValue ( int timeout ) : object
timeout int
return object

validatedTimeout() public static method

Return valid timeout value
If value of the parameter is less then zero, return 0 to mean infinity
public static validatedTimeout ( int timeout ) : int
timeout int
return int