AsyncQueue<T>.TryDequeue Method (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.

Namespace:  Microsoft.VisualStudio.Threading
Assembly:  Microsoft.VisualStudio.Threading (in Microsoft.VisualStudio.Threading.dll)

Syntax

'Declaration
Protected Function TryDequeue ( _
    valueCheck As Predicate(Of T), _
    <OutAttribute> ByRef value As T _
) As Boolean
protected bool TryDequeue(
    Predicate<T> valueCheck,
    out T value
)
protected:
bool TryDequeue(
    Predicate<T>^ valueCheck, 
    [OutAttribute] T% value
)
member TryDequeue : 
        valueCheck:Predicate<'T> * 
        value:'T byref -> bool
protected function TryDequeue(
    valueCheck : Predicate<T>, 
    value : T
) : boolean

Parameters

  • valueCheck
    Type: System.Predicate<T>

    The test on the head element that must succeed to dequeue.

  • value
    Type: T%

    Gets the element from the head of the queue, or the default type if the queue is empty.

Return Value

Type: System.Boolean
true if an element was dequeued, false if the queue was empty.

.NET Framework Security

See Also

Reference

AsyncQueue<T> Class

TryDequeue Overload

Microsoft.VisualStudio.Threading Namespace