Class ObservableBlockingSubscribe
- java.lang.Object
-
- io.reactivex.rxjava3.internal.operators.observable.ObservableBlockingSubscribe
-
public final class ObservableBlockingSubscribe extends java.lang.Object
Utility methods to consume an Observable in a blocking manner with callbacks or Observer.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
ObservableBlockingSubscribe()
Utility class.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <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 java.lang.Throwable> onError, Action onComplete)
Subscribes to the source and calls the given actions on the current thread.
-
-
-
Method Detail
-
subscribe
public 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.- 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:
java.lang.NullPointerException
- ifobserver
isnull
-
subscribe
public static <T> void subscribe(ObservableSource<? extends T> o)
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 java.lang.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.
-
-