|
@@ -11,36 +11,12 @@ namespace System.Linq
|
|
|
partial class AsyncEnumerable
|
|
|
{
|
|
|
#if SUPPORT_FLAT_ASYNC_API
|
|
|
- public static IAsyncEnumerable<TSource> Where<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<bool>> predicate) => WhereAwaitCore<TSource>(source, predicate);
|
|
|
- public static IAsyncEnumerable<TSource> Where<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, int, ValueTask<bool>> predicate) => WhereAwaitCore<TSource>(source, predicate);
|
|
|
public static IAsyncEnumerable<TResult> Zip<TFirst, TSecond, TResult>(this IAsyncEnumerable<TFirst> first, IAsyncEnumerable<TSecond> second, Func<TFirst, TSecond, ValueTask<TResult>> selector) => ZipAwaitCore<TFirst, TSecond, TResult>(first, second, selector);
|
|
|
|
|
|
#if !NO_DEEP_CANCELLATION
|
|
|
- public static IAsyncEnumerable<TSource> Where<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<bool>> predicate) => WhereAwaitWithCancellationCore<TSource>(source, predicate);
|
|
|
- public static IAsyncEnumerable<TSource> Where<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, int, CancellationToken, ValueTask<bool>> predicate) => WhereAwaitWithCancellationCore<TSource>(source, predicate);
|
|
|
public static IAsyncEnumerable<TResult> Zip<TFirst, TSecond, TResult>(this IAsyncEnumerable<TFirst> first, IAsyncEnumerable<TSecond> second, Func<TFirst, TSecond, CancellationToken, ValueTask<TResult>> selector) => ZipAwaitWithCancellationCore<TFirst, TSecond, TResult>(first, second, selector);
|
|
|
#endif
|
|
|
#else
|
|
|
- /// <summary>
|
|
|
- /// Filters the elements of an async-enumerable sequence based on an asynchronous predicate.
|
|
|
- /// </summary>
|
|
|
- /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
|
|
|
- /// <param name="source">An async-enumerable sequence whose elements to filter.</param>
|
|
|
- /// <param name="predicate">An asynchronous predicate to test each source element for a condition.</param>
|
|
|
- /// <returns>An async-enumerable sequence that contains elements from the input sequence that satisfy the condition.</returns>
|
|
|
- /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="predicate"/> is null.</exception>
|
|
|
- public static IAsyncEnumerable<TSource> WhereAwait<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<bool>> predicate) => WhereAwaitCore<TSource>(source, predicate);
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// Filters the elements of an async-enumerable sequence based on an asynchronous predicate that incorporates the element's index.
|
|
|
- /// </summary>
|
|
|
- /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
|
|
|
- /// <param name="source">An async-enumerable sequence whose elements to filter.</param>
|
|
|
- /// <param name="predicate">An asynchronous predicate to test each source element for a condition; the second parameter of the function represents the index of the source element.</param>
|
|
|
- /// <returns>An async-enumerable sequence that contains elements from the input sequence that satisfy the condition.</returns>
|
|
|
- /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="predicate"/> is null.</exception>
|
|
|
- public static IAsyncEnumerable<TSource> WhereAwait<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, int, ValueTask<bool>> predicate) => WhereAwaitCore<TSource>(source, predicate);
|
|
|
-
|
|
|
/// <summary>
|
|
|
/// Merges two async-enumerable sequences into one async-enumerable sequence by combining their elements in a pairwise fashion.
|
|
|
/// </summary>
|
|
@@ -55,8 +31,6 @@ namespace System.Linq
|
|
|
public static IAsyncEnumerable<TResult> ZipAwait<TFirst, TSecond, TResult>(this IAsyncEnumerable<TFirst> first, IAsyncEnumerable<TSecond> second, Func<TFirst, TSecond, ValueTask<TResult>> selector) => ZipAwaitCore<TFirst, TSecond, TResult>(first, second, selector);
|
|
|
|
|
|
#if !NO_DEEP_CANCELLATION
|
|
|
- public static IAsyncEnumerable<TSource> WhereAwaitWithCancellation<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<bool>> predicate) => WhereAwaitWithCancellationCore<TSource>(source, predicate);
|
|
|
- public static IAsyncEnumerable<TSource> WhereAwaitWithCancellation<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, int, CancellationToken, ValueTask<bool>> predicate) => WhereAwaitWithCancellationCore<TSource>(source, predicate);
|
|
|
public static IAsyncEnumerable<TResult> ZipAwaitWithCancellation<TFirst, TSecond, TResult>(this IAsyncEnumerable<TFirst> first, IAsyncEnumerable<TSecond> second, Func<TFirst, TSecond, CancellationToken, ValueTask<TResult>> selector) => ZipAwaitWithCancellationCore<TFirst, TSecond, TResult>(first, second, selector);
|
|
|
#endif
|
|
|
#endif
|