Пример #1
0
        public static void SubscribeAwait <TSource>(this IUniTaskAsyncEnumerable <TSource> source, Func <TSource, CancellationToken, UniTask> onNext, CancellationToken cancellationToken)
        {
            Error.ThrowArgumentNullException(source, nameof(source));
            Error.ThrowArgumentNullException(onNext, nameof(onNext));

            Subscribes.SubscribeAwaitCore(source, onNext, Subscribes.NopError, Subscribes.NopCompleted, cancellationToken).Forget();
        }
Пример #2
0
        public static IDisposable SubscribeAwait <TSource>(this IUniTaskAsyncEnumerable <TSource> source, Func <TSource, CancellationToken, UniTask> onNext)
        {
            Error.ThrowArgumentNullException(source, nameof(source));
            Error.ThrowArgumentNullException(onNext, nameof(onNext));

            var cts = new CancellationTokenDisposable();

            Subscribes.SubscribeAwaitCore(source, onNext, Subscribes.NopError, Subscribes.NopCompleted, cts.Token).Forget();
            return(cts);
        }