TaskAsyncEnumerableExtensions.WithCancellation<T> Metoda

Definicja

Ustawia element CancellationToken do przekazania podczas GetAsyncEnumerator(CancellationToken) iteracji.

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)

Parametry typu

T

Typ obiektów do iterowania.

Parametry

source
IAsyncEnumerable<T>

Źródło można wyliczyć do iterowania.

cancellationToken
CancellationToken

Token anulowania do użycia.

Zwraca

Skonfigurowano wyliczanie.

Dotyczy