예제 #1
0
        public static void Subscribe <TSource>(this IUniTaskAsyncEnumerable <TSource> source, Func <TSource, UniTaskVoid> action, CancellationToken cancellationToken)
        {
            Error.ThrowArgumentNullException(source, nameof(source));
            Error.ThrowArgumentNullException(action, nameof(action));

            Subscribes.SubscribeCore(source, action, Subscribes.NopError, Subscribes.NopCompleted, cancellationToken).Forget();
        }
예제 #2
0
        public static void Subscribe <TSource>(this IUniTaskAsyncEnumerable <TSource> source, IObserver <TSource> observer, CancellationToken cancellationToken)
        {
            Error.ThrowArgumentNullException(source, nameof(source));
            Error.ThrowArgumentNullException(observer, nameof(observer));

            Subscribes.SubscribeCore(source, observer, cancellationToken).Forget();
        }
예제 #3
0
        public static void Subscribe <TSource>(this IUniTaskAsyncEnumerable <TSource> source, Action <TSource> onNext, Action <Exception> onError, CancellationToken cancellationToken)
        {
            Error.ThrowArgumentNullException(source, nameof(source));
            Error.ThrowArgumentNullException(onNext, nameof(onNext));
            Error.ThrowArgumentNullException(onError, nameof(onError));

            Subscribes.SubscribeCore(source, onNext, onError, Subscribes.NopCompleted, cancellationToken).Forget();
        }
예제 #4
0
        public static IDisposable Subscribe <TSource>(this IUniTaskAsyncEnumerable <TSource> source, Func <TSource, UniTaskVoid> action)
        {
            Error.ThrowArgumentNullException(source, nameof(source));
            Error.ThrowArgumentNullException(action, nameof(action));

            var cts = new CancellationTokenDisposable();

            Subscribes.SubscribeCore(source, action, Subscribes.NopError, Subscribes.NopCompleted, cts.Token).Forget();
            return(cts);
        }
예제 #5
0
        // IObserver

        public static IDisposable Subscribe <TSource>(this IUniTaskAsyncEnumerable <TSource> source, IObserver <TSource> observer)
        {
            Error.ThrowArgumentNullException(source, nameof(source));
            Error.ThrowArgumentNullException(observer, nameof(observer));

            var cts = new CancellationTokenDisposable();

            Subscribes.SubscribeCore(source, observer, cts.Token).Forget();
            return(cts);
        }
예제 #6
0
        // OnNext, OnCompleted

        public static IDisposable Subscribe <TSource>(this IUniTaskAsyncEnumerable <TSource> source, Action <TSource> onNext, Action onCompleted)
        {
            Error.ThrowArgumentNullException(source, nameof(source));
            Error.ThrowArgumentNullException(onNext, nameof(onNext));
            Error.ThrowArgumentNullException(onCompleted, nameof(onCompleted));

            var cts = new CancellationTokenDisposable();

            Subscribes.SubscribeCore(source, onNext, Subscribes.NopError, onCompleted, cts.Token).Forget();
            return(cts);
        }