ConfiguredCancelableAsyncEnumerable<T>.WithCancellation 方法

定义

设置迭代时要传递给 GetAsyncEnumerator(CancellationToken)CancellationToken

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)

参数

cancellationToken
CancellationToken

要使用的 CancellationToken

返回

配置的可枚举。

注解

这将替换此迭代 WithCancellation(CancellationToken) 设置的任何以前的 CancellationToken

适用于