IAsyncEnumerableExtensionsWithAwaitConfiguredCancellationT Method

Sets the CancellationToken to be passed to GetAsyncEnumerator(CancellationToken) when iterating and configures how awaits on the tasks returned from an async iteration will be performed, defaults to not capturing.

Definition

Namespace: Gemstone.Collections.IAsyncEnumerableExtensions
Assembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.170 -- Release Build+d52ae7197b8b2924ea9e1e530d25301718816611
public static ConfiguredCancelableAsyncEnumerable<T> WithAwaitConfiguredCancellation<T>(
	this IAsyncEnumerable<T> source,
	CancellationToken cancellationToken,
	bool continueOnCapturedContext = false
)

Parameters

source  IAsyncEnumerableT
The source enumerable being iterated.
cancellationToken  CancellationToken
The CancellationToken to use.
continueOnCapturedContext  Boolean  (Optional)
Whether to capture and marshal back to the current context.

Type Parameters

T
The type of the objects being iterated.

Return Value

ConfiguredCancelableAsyncEnumerableT
The configured enumerable.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IAsyncEnumerableT. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks

The WithCancellationT(IAsyncEnumerableT, CancellationToken) extension method sets continueOnCapturedContext to true, this extension method allows the to be set false, the default value for this extension method.

See Also