ConfiguredCancelableAsyncEnumerable<T>.WithCancellation Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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)
Parameters
- cancellationToken
- CancellationToken
The CancellationToken to use.
Returns
The configured enumerable.
Remarks
This will replace any previous CancellationToken set by WithCancellation(CancellationToken) for this iteration.
Applies to
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.