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(); }
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(); }
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(); }
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); }
// 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); }
// 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); }