Open sandboxFocus

Class AsyncEnumerableHelper

Helper methods related to IAsyncEnumerable<T> and IAsyncEnumerator<T>.

Inheritance
AsyncEnumerableHelper
Namespace: Metalama.Patterns.Caching.Aspects.Helpers
Assembly: Metalama.Patterns.Caching.Aspects.dll
Syntax
public static class AsyncEnumerableHelper
Remarks

This class is used by code generated by caching framework aspects.

Methods

Name Description
AsAsyncEnumerable<T>(Task<IAsyncEnumerable<T>>)

If task is already completed, returns the result of the task; otherwise, returns an instance of IAsyncEnumerable<T> which awaits the task in MoveNextAsync() then creates and delegates to an enumerator from the result of the task.

AsAsyncEnumerable<T>(ValueTask<IAsyncEnumerable<T>?>)

If task is already completed, returns the result of the task; otherwise, returns an instance of IAsyncEnumerable<T> which awaits the task in MoveNextAsync() then creates and delegates to an enumerator from the result of the task.

AsAsyncEnumerator<T>(Task<IAsyncEnumerator<T>?>)

If task is already completed, returns the result of the task; otherwise, returns an instance of IAsyncEnumerator<T> which awaits the task in MoveNextAsync() then delegates to the enumerator from the result of the task.

AsAsyncEnumerator<T>(ValueTask<IAsyncEnumerator<T>?>)

If task is already completed, returns the result of the task; otherwise, returns an instance of IAsyncEnumerator<T> which awaits the task in MoveNextAsync() then delegates to the enumerator from the result of the task.