DataflowBlock.ReceiveAllAsync<TOutput> Method

Definition

Creates an IAsyncEnumerable<T> that enables receiving all of the data from the source.

C#
public static System.Collections.Generic.IAsyncEnumerable<TOutput> ReceiveAllAsync<TOutput>(this System.Threading.Tasks.Dataflow.IReceivableSourceBlock<TOutput> source, System.Threading.CancellationToken cancellationToken = default);

Type Parameters

TOutput

Specifies the type of data contained in the source.

Parameters

source
IReceivableSourceBlock<TOutput>

The source from which to asynchronously receive.

cancellationToken
CancellationToken

The CancellationToken that can be used to cancel the receive operation.

Returns

IAsyncEnumerable<TOutput>

The created async enumerable.

Exceptions

The source is null.

The cancellation token was canceled. This exception is stored into the returned task.

Applies to

Product Versions
.NET 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.1 (package-provided)