Class ObservableBlockingSubscribe
java.lang.Object
io.reactivex.rxjava3.internal.operators.observable.ObservableBlockingSubscribe
Utility methods to consume an Observable in a blocking manner with callbacks or Observer.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> void
subscribe
(ObservableSource<? extends T> o) Runs the source observable to a terminal event, ignoring any values and rethrowing any exception.static <T> void
subscribe
(ObservableSource<? extends T> o, Observer<? super T> observer) Subscribes to the source and calls the Observer methods on the current thread.static <T> void
subscribe
(ObservableSource<? extends T> o, Consumer<? super T> onNext, Consumer<? super Throwable> onError, Action onComplete) Subscribes to the source and calls the given actions on the current thread.
-
Constructor Details
-
ObservableBlockingSubscribe
private ObservableBlockingSubscribe()Utility class.
-
-
Method Details
-
subscribe
Subscribes to the source and calls the Observer methods on the current thread.- Type Parameters:
T
- the value type- Parameters:
o
- the source ObservableSource The call to dispose() is composed through.observer
- the subscriber to forward events and calls to in the current thread- Throws:
NullPointerException
- ifobserver
isnull
-
subscribe
Runs the source observable to a terminal event, ignoring any values and rethrowing any exception.- Type Parameters:
T
- the value type- Parameters:
o
- the source ObservableSource
-
subscribe
public static <T> void subscribe(ObservableSource<? extends T> o, Consumer<? super T> onNext, Consumer<? super Throwable> onError, Action onComplete) Subscribes to the source and calls the given actions on the current thread.- Type Parameters:
T
- the value type- Parameters:
o
- the source ObservableSourceonNext
- the callback action for each source valueonError
- the callback action for an error eventonComplete
- the callback action for the completion event.
-