Package hu.akarnokd.rxjava3.consumers
Class FlowableConsumers
- java.lang.Object
-
- hu.akarnokd.rxjava3.consumers.FlowableConsumers
-
public final class FlowableConsumers extends java.lang.ObjectUtility methods for creating and using consumersFlowables.- Since:
- 0.18.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> DisposablesubscribeAutoDispose(Flowable<T> source, CompositeDisposable composite, Consumer<? super T> onNext)Wraps the given onXXX callbacks into aDisposableSubscriber, adds it to the givenCompositeDisposableand ensures, that if the upstream completes or this particlular Disposable is disposed, the Subscriber is removed from the given composite.static <T> DisposablesubscribeAutoDispose(Flowable<T> source, CompositeDisposable composite, Consumer<? super T> onNext, Consumer<? super java.lang.Throwable> onError)Wraps the given onXXX callbacks into aDisposableSubscriber, adds it to the givenCompositeDisposableand ensures, that if the upstream completes or this particlular Disposable is disposed, the Subscriber is removed from the given composite.static <T> DisposablesubscribeAutoDispose(Flowable<T> source, CompositeDisposable composite, Consumer<? super T> onNext, Consumer<? super java.lang.Throwable> onError, Action onComplete)Wraps the given onXXX callbacks into aDisposableSubscriber, adds it to the givenCompositeDisposableand ensures, that if the upstream completes or this particlular Disposable is disposed, the Subscriber is removed from the given composite.
-
-
-
Method Detail
-
subscribeAutoDispose
public static <T> Disposable subscribeAutoDispose(Flowable<T> source, CompositeDisposable composite, Consumer<? super T> onNext)
Wraps the given onXXX callbacks into aDisposableSubscriber, adds it to the givenCompositeDisposableand ensures, that if the upstream completes or this particlular Disposable is disposed, the Subscriber is removed from the given composite.The Subscriber will be removed after the callback for the terminal event has been invoked.
- Type Parameters:
T- the value type- Parameters:
source- the source Flowable to subscribe to.composite- the composite Disposable to add and remove the created Disposable SubscriberonNext- the callback for upstream items- Returns:
- the Disposable that allows disposing the particular subscription.
-
subscribeAutoDispose
public static <T> Disposable subscribeAutoDispose(Flowable<T> source, CompositeDisposable composite, Consumer<? super T> onNext, Consumer<? super java.lang.Throwable> onError)
Wraps the given onXXX callbacks into aDisposableSubscriber, adds it to the givenCompositeDisposableand ensures, that if the upstream completes or this particlular Disposable is disposed, the Subscriber is removed from the given composite.The Subscriber will be removed after the callback for the terminal event has been invoked.
- Type Parameters:
T- the value type- Parameters:
source- the source Flowable to subscribe to.composite- the composite Disposable to add and remove the created Disposable SubscriberonNext- the callback for upstream itemsonError- the callback for an upstream error if any- Returns:
- the Disposable that allows disposing the particular subscription.
-
subscribeAutoDispose
public static <T> Disposable subscribeAutoDispose(Flowable<T> source, CompositeDisposable composite, Consumer<? super T> onNext, Consumer<? super java.lang.Throwable> onError, Action onComplete)
Wraps the given onXXX callbacks into aDisposableSubscriber, adds it to the givenCompositeDisposableand ensures, that if the upstream completes or this particlular Disposable is disposed, the Subscriber is removed from the given composite.The Subscriber will be removed after the callback for the terminal event has been invoked.
- Type Parameters:
T- the value type- Parameters:
source- the source Flowable to subscribe to.composite- the composite Disposable to add and remove the created Disposable SubscriberonNext- the callback for upstream itemsonError- the callback for an upstream error if anyonComplete- the callback for the upstream completion if any- Returns:
- the Disposable that allows disposing the particular subscription.
-
-