Compartir a través de


TaskAsyncEnumerableExtensions.WithCancellation<T> Método

Definición

Establece el CancellationToken que se va a pasar a GetAsyncEnumerator(CancellationToken) al iterar.

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static System::Runtime::CompilerServices::ConfiguredCancelableAsyncEnumerable<T> WithCancellation(System::Collections::Generic::IAsyncEnumerable<T> ^ source, System::Threading::CancellationToken cancellationToken);
public static System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable<T> WithCancellation<T> (this System.Collections.Generic.IAsyncEnumerable<T> source, System.Threading.CancellationToken cancellationToken);
static member WithCancellation : System.Collections.Generic.IAsyncEnumerable<'T> * System.Threading.CancellationToken -> System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable<'T>
<Extension()>
Public Function WithCancellation(Of T) (source As IAsyncEnumerable(Of T), cancellationToken As CancellationToken) As ConfiguredCancelableAsyncEnumerable(Of T)

Parámetros de tipo

T

Tipo de los objetos que se iteran.

Parámetros

source
IAsyncEnumerable<T>

El origen enumerable que se está iterando.

cancellationToken
CancellationToken

El CancellationToken que se va a usar.

Devoluciones

Enumerable configurado.

Se aplica a