Take Method
From Task Parallel System.Threading
|
|
| .NET Framework Class Library |
| BlockingCollection<(Of <(T>)>)..::.Take Method |
| BlockingCollection<(Of <(T>)>) Class See Also Send Feedback |
Takes an item from the BlockingCollection<(Of <(T>)>).
Namespace:
System.Collections.Concurrent
Assembly:
System.Threading (in System.Threading.dll)
Syntax
| Visual Basic (Declaration) |
|---|
Public Function Take As T |
| C# |
|---|
public T Take() |
Return Value
The item removed from the collection.
Remarks
A call to Take()()() may block until an item is available to be removed.
Exceptions
| Exception | Condition |
|---|---|
| System..::.OperationCanceledException | The BlockingCollection<(Of <(T>)>) is empty and has been marked as complete with regards to additions. |
| System..::.ObjectDisposedException | The BlockingCollection<(Of <(T>)>) has been disposed. |
| System..::.InvalidOperationException | The underlying collection was modified outside of this BlockingCollection<(Of <(T>)>) instance. |