AsyncQueue<T> Class
A thread-safe, asynchronously dequeuable queue.
Inheritance Hierarchy
System.Object
Microsoft.VisualStudio.Threading.AsyncQueue<T>
Namespace: Microsoft.VisualStudio.Threading
Assembly: Microsoft.VisualStudio.Threading (in Microsoft.VisualStudio.Threading.dll)
Syntax
'Declaration
Public Class AsyncQueue(Of T)
public class AsyncQueue<T>
generic<typename T>
public ref class AsyncQueue
type AsyncQueue<'T> = class end
JScript does not support generic types or methods.
Type Parameters
- T
The type of values kept by the queue.
The AsyncQueue<T> type exposes the following members.
Constructors
Name | Description | |
---|---|---|
AsyncQueue<T> | Initializes a new instance of AsyncQueue. |
Top
Properties
Name | Description | |
---|---|---|
Completion | The source of the task returned by Completion. This is lazily constructed. | |
Count | Gets the number of elements currently in the queue. | |
InitialCapacity | Gets the initial capacity for the queue. | |
IsCompleted | Determines whether the queue has completed. | |
IsEmpty | Determines whether the queue is currently empty. | |
SyncRoot | Gets the synchronization object used by this queue. |
Top
Methods
Name | Description | |
---|---|---|
Complete | Signals that no further elements will be enqueued. | |
DequeueAsync | Gets a task whose result is the element at the head of the queue. | |
Enqueue | Adds an element to the tail of the queue. | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
OnCompleted | Occurs when the queue is completed. | |
OnDequeued | Occurs when a value is dequeued. | |
OnEnqueued | Occurs when a value is enqueued. | |
Peek | Gets the value at the head of the queue without removing it from the queue. | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
TryDequeue(T%) | Immediately dequeues the element from the head of the queue if one is available, otherwise returns without an element. | |
TryDequeue(Predicate<T>, T%) | Immediately dequeues the element from the head of the queue if one is available that satisfies the specified check, otherwise returns without an element. | |
TryEnqueue | Adds an element to the tail of the queue if it has not yet completed. | |
TryPeek | Gets the value at the head of the queue without removing it from the queue, if it is non-empty. |
Top
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.