ConcurrentQueue<T>.IProducerConsumerCollection<T>.TryTake(T) ConcurrentQueue<T>.IProducerConsumerCollection<T>.TryTake(T) ConcurrentQueue<T>.IProducerConsumerCollection<T>.TryTake(T) Method

Definition

Attempts to remove and return an object from the IProducerConsumerCollection<T>.

 virtual bool System.Collections.Concurrent.IProducerConsumerCollection<T>.TryTake([Runtime::InteropServices::Out] T % item) = System::Collections::Concurrent::IProducerConsumerCollection<T>::TryTake;
bool IProducerConsumerCollection<T>.TryTake (out T item);
Function TryTake (ByRef item As T) As Boolean Implements IProducerConsumerCollection(Of T).TryTake

Parameters

item
T T T

When this method returns, if the operation was successful, item contains the object removed. If no object was available to be removed, the value is unspecified.

Returns

true if an element was removed and returned successfully; otherwise, false.

Implements

Remarks

For ConcurrentQueue<T>, this operation will attempt to remove the object from the beginning of the ConcurrentQueue<T>.

Applies to

See also