IEnumerable
| Flags | Name | Summary |
|---|---|---|
| public | SharedQueue()
|
Construct a fresh, empty SharedQueue. |
| Flags | Name | Summary |
|---|---|---|
| public | void Close()
|
Close the queue. Causes all further Enqueue() operations to throw EndOfStreamException, and all pending or subsequent Dequeue() operations to throw an EndOfStreamException once the queue is empty. |
| public | bool Dequeue(int millisecondsTimeout, out object result)
|
Retrieve the first item from the queue, or return nothing if no items are available after the given timeout |
| public | object Dequeue()
|
Retrieve the first item from the queue, or block if none available |
| public | object DequeueNoWait(object defaultValue)
|
Retrieve the first item from the queue, or return defaultValue immediately if no items are available |
| public | void Enqueue(object o)
|
Place an item at the end of the queue. |
public void Close()
| Flags | public |
|---|---|
| Return type | |
public bool Dequeue(int millisecondsTimeout, out object result)
| Flags | public | ||||||
|---|---|---|---|---|---|---|---|
| Return type | |
||||||
| Parameters |
|
If one or more items are present on the queue at the time the call is made, the call will return immediately. Otherwise, the calling thread blocks until either an item appears on the queue, or millisecondsTimeout milliseconds have elapsed.
Returns true in the case that an item was available before the timeout, in which case the out parameter "result" is set to the item itself.
If no items were available before the timeout, returns false, and sets "result" to null.
A timeout of -1 (i.e. System.Threading.Timeout.Infinite) will be interpreted as a command to wait for an indefinitely long period of time for an item to become available. Usage of such a timeout is equivalent to calling Dequeue() with no arguments. See also the MSDN documentation for System.Threading.Monitor.Wait(object,int).
If no items are present and the queue is in a closed state, or if at any time while waiting the queue transitions to a closed state (by a call to Close()), this method will throw EndOfStreamException.
public object Dequeue()
| Flags | public |
|---|---|
| Return type | |
public object DequeueNoWait(object defaultValue)
| Flags | public | ||||
|---|---|---|---|---|---|
| Return type | |
||||
| Parameters |
|
If one or more objects are present in the queue at the time of the call, the first item is removed from the queue and returned. Otherwise, the defaultValue that was passed in is returned immediately. This defaultValue may be null, or in cases where null is part of the range of the queue, may be some other sentinel object. The difference between DequeueNoWait() and Dequeue() is that DequeueNoWait() will not block when no items are available in the queue, whereas Dequeue() will.
If at the time of call the queue is empty and in a closed state (following a call to Close()), then this method will throw EndOfStreamException.
public void Enqueue(object o)
| Flags | public | ||||
|---|---|---|---|---|---|
| Return type | |
||||
| Parameters |
|