다음을 통해 공유


TaskAsyncEnumerableExtensions.WithCancellation<T> 메서드

정의

반복할 때 GetAsyncEnumerator(CancellationToken) 전달할 CancellationToken 설정합니다.

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)

형식 매개 변수

T

반복되는 개체의 형식입니다.

매개 변수

source
IAsyncEnumerable<T>

반복할 원본 열거 가능입니다.

cancellationToken
CancellationToken

사용할 CancellationToken.

반환

구성된 열거형입니다.

적용 대상