public Cast(IUniTaskAsyncEnumerable <object> source) { this.source = source; }
public static void BindTo <T>(this IUniTaskAsyncEnumerable <T> source, Text text, CancellationToken cancellationToken, bool rebindOnError = true) { BindToCore(source, text, cancellationToken, rebindOnError).Forget(); }
public static IUniTaskAsyncEnumerable <TSource> Except <TSource>(this IUniTaskAsyncEnumerable <TSource> first, IUniTaskAsyncEnumerable <TSource> second, IEqualityComparer <TSource> comparer) { Error.ThrowArgumentNullException(first, nameof(first)); Error.ThrowArgumentNullException(second, nameof(second)); Error.ThrowArgumentNullException(comparer, nameof(comparer)); return(new Except <TSource>(first, second, comparer)); }
// <string> -> Text public static void BindTo(this IUniTaskAsyncEnumerable <string> source, Text text, bool rebindOnError = true) { BindToCore(source, text, text.GetCancellationTokenOnDestroy(), rebindOnError).Forget(); }
// <T> -> Action public static void BindTo <TSource, TObject>(this IUniTaskAsyncEnumerable <TSource> source, TObject monoBehaviour, Action <TObject, TSource> bindAction, bool rebindOnError = true) where TObject : MonoBehaviour { BindToCore(source, monoBehaviour, bindAction, monoBehaviour.GetCancellationTokenOnDestroy(), rebindOnError).Forget(); }
public static IUniTaskAsyncEnumerable <TSource> DistinctUntilChangedAwaitWithCancellation <TSource, TKey>(this IUniTaskAsyncEnumerable <TSource> source, Func <TSource, CancellationToken, UniTask <TKey> > keySelector) { return(DistinctUntilChangedAwaitWithCancellation(source, keySelector, EqualityComparer <TKey> .Default)); }
public DistinctUntilChanged(IUniTaskAsyncEnumerable <TSource> source, IEqualityComparer <TSource> comparer) { this.source = source; this.comparer = comparer; }
internal static async UniTask <Dictionary <TKey, TElement> > ToDictionaryAwaitWithCancellationAsync <TSource, TKey, TElement>(IUniTaskAsyncEnumerable <TSource> source, Func <TSource, CancellationToken, UniTask <TKey> > keySelector, Func <TSource, CancellationToken, UniTask <TElement> > elementSelector, IEqualityComparer <TKey> comparer, CancellationToken cancellationToken) { var dict = new Dictionary <TKey, TElement>(comparer); var e = source.GetAsyncEnumerator(cancellationToken); try { while (await e.MoveNextAsync()) { var v = e.Current; var key = await keySelector(v, cancellationToken); var value = await elementSelector(v, cancellationToken); dict.Add(key, value); } } finally { if (e != null) { await e.DisposeAsync(); } } return(dict); }
public static UniTask <Dictionary <TKey, TSource> > ToDictionaryAwaitAsync <TSource, TKey>(this IUniTaskAsyncEnumerable <TSource> source, Func <TSource, UniTask <TKey> > keySelector, IEqualityComparer <TKey> comparer, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); Error.ThrowArgumentNullException(comparer, nameof(comparer)); return(ToDictionary.ToDictionaryAwaitAsync(source, keySelector, comparer, cancellationToken)); }
public _Queue(IUniTaskAsyncEnumerable <TSource> source, CancellationToken cancellationToken) { this.source = source; this.cancellationToken = cancellationToken; }
public static IUniTaskAsyncEnumerable <TSource> Queue <TSource>(this IUniTaskAsyncEnumerable <TSource> source) { return(new QueueOperator <TSource>(source)); }
public QueueOperator(IUniTaskAsyncEnumerable <TSource> source) { this.source = source; }
public static IUniTaskAsyncEnumerable <TResult> Cast <TResult>(this IUniTaskAsyncEnumerable <Object> source) { Error.ThrowArgumentNullException(source, nameof(source)); return(new Cast <TResult>(source)); }
public _Cast(IUniTaskAsyncEnumerable <object> source, CancellationToken cancellationToken) : base(source, cancellationToken) { }
public static IUniTaskAsyncEnumerable <TSource> DistinctUntilChanged <TSource>(this IUniTaskAsyncEnumerable <TSource> source, IEqualityComparer <TSource> comparer) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(comparer, nameof(comparer)); return(new DistinctUntilChanged <TSource>(source, comparer)); }
public static UniTask <Dictionary <TKey, TElement> > ToDictionaryAwaitWithCancellationAsync <TSource, TKey, TElement>(this IUniTaskAsyncEnumerable <TSource> source, Func <TSource, CancellationToken, UniTask <TKey> > keySelector, Func <TSource, CancellationToken, UniTask <TElement> > elementSelector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); return(ToDictionary.ToDictionaryAwaitWithCancellationAsync(source, keySelector, elementSelector, EqualityComparer <TKey> .Default, cancellationToken)); }
public static IUniTaskAsyncEnumerable <TSource> DistinctUntilChanged <TSource, TKey>(this IUniTaskAsyncEnumerable <TSource> source, Func <TSource, TKey> keySelector) { return(DistinctUntilChanged(source, keySelector, EqualityComparer <TKey> .Default)); }
public static IUniTaskAsyncEnumerable <TResult> SelectMany <TSource, TCollection, TResult>(this IUniTaskAsyncEnumerable <TSource> source, Func <TSource, IUniTaskAsyncEnumerable <TCollection> > collectionSelector, Func <TSource, TCollection, TResult> resultSelector) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(collectionSelector, nameof(collectionSelector)); return(new SelectMany <TSource, TCollection, TResult>(source, collectionSelector, resultSelector)); }
public static IUniTaskAsyncEnumerable <TSource> DistinctUntilChangedAwaitWithCancellation <TSource, TKey>(this IUniTaskAsyncEnumerable <TSource> source, Func <TSource, CancellationToken, UniTask <TKey> > keySelector, IEqualityComparer <TKey> comparer) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); Error.ThrowArgumentNullException(comparer, nameof(comparer)); return(new DistinctUntilChangedAwaitWithCancellation <TSource, TKey>(source, keySelector, comparer)); }
public static IUniTaskAsyncEnumerable <TResult> SelectMany <TSource, TResult>(this IUniTaskAsyncEnumerable <TSource> source, Func <TSource, IUniTaskAsyncEnumerable <TResult> > selector) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(selector, nameof(selector)); return(new SelectMany <TSource, TResult, TResult>(source, selector, (x, y) => y)); }
public static IUniTaskAsyncEnumerable <TSource> DistinctUntilChanged <TSource>(this IUniTaskAsyncEnumerable <TSource> source) { return(DistinctUntilChanged(source, EqualityComparer <TSource> .Default)); }
public static IUniTaskAsyncEnumerable <TResult> SelectManyAwaitWithCancellation <TSource, TResult>(this IUniTaskAsyncEnumerable <TSource> source, Func <TSource, Int32, CancellationToken, UniTask <IUniTaskAsyncEnumerable <TResult> > > selector) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(selector, nameof(selector)); return(new SelectManyAwaitWithCancellation <TSource, TResult, TResult>(source, selector, (x, y, c) => UniTask.FromResult(y))); }
public static void BindTo(this IUniTaskAsyncEnumerable <bool> source, Selectable selectable, CancellationToken cancellationToken, bool rebindOnError = true) { BindToCore(source, selectable, cancellationToken, rebindOnError).Forget(); }
public static IUniTaskAsyncEnumerable <TResult> SelectManyAwaitWithCancellation <TSource, TCollection, TResult>(this IUniTaskAsyncEnumerable <TSource> source, Func <TSource, Int32, CancellationToken, UniTask <IUniTaskAsyncEnumerable <TCollection> > > collectionSelector, Func <TSource, TCollection, CancellationToken, UniTask <TResult> > resultSelector) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(collectionSelector, nameof(collectionSelector)); return(new SelectManyAwaitWithCancellation <TSource, TCollection, TResult>(source, collectionSelector, resultSelector)); }
public static void BindTo <TSource, TObject>(this IUniTaskAsyncEnumerable <TSource> source, TObject bindTarget, Action <TObject, TSource> bindAction, CancellationToken cancellationToken, bool rebindOnError = true) { BindToCore(source, bindTarget, bindAction, cancellationToken, rebindOnError).Forget(); }
public static UniTask ForEachAsync <T>(this IUniTaskAsyncEnumerable <T> source, Func <T, int, UniTask> action, CancellationToken cancellationToken = default) { throw new NotSupportedException("Use ForEachAwaitAsync instead."); }
public Concat(IUniTaskAsyncEnumerable <TSource> first, IUniTaskAsyncEnumerable <TSource> second) { this.first = first; this.second = second; }
public AsyncEnumeratorBase(IUniTaskAsyncEnumerable <TSource> source, CancellationToken cancellationToken) { this.source = source; this.cancellationToken = cancellationToken; TaskTracker.TrackActiveTask(this, 4); }
public Except(IUniTaskAsyncEnumerable <TSource> first, IUniTaskAsyncEnumerable <TSource> second, IEqualityComparer <TSource> comparer) { this.first = first; this.second = second; this.comparer = comparer; }
public static IUniTaskAsyncEnumerable <TResult> GroupJoinAwaitWithCancellation <TOuter, TInner, TKey, TResult>(this IUniTaskAsyncEnumerable <TOuter> outer, IUniTaskAsyncEnumerable <TInner> inner, Func <TOuter, CancellationToken, UniTask <TKey> > outerKeySelector, Func <TInner, CancellationToken, UniTask <TKey> > innerKeySelector, Func <TOuter, IEnumerable <TInner>, CancellationToken, UniTask <TResult> > resultSelector, IEqualityComparer <TKey> comparer) { Error.ThrowArgumentNullException(outer, nameof(outer)); Error.ThrowArgumentNullException(inner, nameof(inner)); Error.ThrowArgumentNullException(outerKeySelector, nameof(outerKeySelector)); Error.ThrowArgumentNullException(innerKeySelector, nameof(innerKeySelector)); Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); Error.ThrowArgumentNullException(comparer, nameof(comparer)); return(new GroupJoinAwaitWithCancellation <TOuter, TInner, TKey, TResult>(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer)); }