ConfiguredCancelableAsyncEnumerable<T>.WithCancellation(CancellationToken) Método

Definición

Establece el elemento CancellationToken que se va a pasar a GetAsyncEnumerator(CancellationToken) durante la iteración.Sets the CancellationToken to be passed to GetAsyncEnumerator(CancellationToken) when iterating.

public:
 System::Runtime::CompilerServices::ConfiguredCancelableAsyncEnumerable<T> WithCancellation(System::Threading::CancellationToken cancellationToken);
public System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable<T> WithCancellation (System.Threading.CancellationToken cancellationToken);
member this.WithCancellation : System.Threading.CancellationToken -> System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable<'T>
Public Function WithCancellation (cancellationToken As CancellationToken) As ConfiguredCancelableAsyncEnumerable(Of T)

Parámetros

cancellationToken
CancellationToken

Token de cancelación que se va a usar.The cancellation token to use.

Devoluciones

ConfiguredCancelableAsyncEnumerable<T>

Elemento enumerable configurado.The configured enumerable.

Comentarios

Esto reemplazará cualquier CancellationToken anterior establecido por WithCancellation(CancellationToken) para esta iteración.This will replace any previous CancellationToken set by WithCancellation(CancellationToken) for this iteration.

Se aplica a