public final class NbpBlockingObservable<T>
extends java.lang.Object
implements java.lang.Iterable<T>
| Modifier | Constructor and Description |
|---|---|
protected |
NbpBlockingObservable(NbpObservable<? extends T> source) |
| Modifier and Type | Method and Description |
|---|---|
T |
first() |
T |
first(T defaultValue) |
Optional<T> |
firstOption() |
void |
forEach(Consumer<? super T> action) |
static <T> NbpBlockingObservable<T> |
from(NbpObservable<? extends T> source) |
java.util.Iterator<T> |
iterator() |
T |
last() |
T |
last(T defaultValue) |
Optional<T> |
lastOption() |
java.lang.Iterable<T> |
latest() |
java.lang.Iterable<T> |
mostRecent(T initialValue) |
java.lang.Iterable<T> |
next() |
void |
run()
Runs the source observable to a terminal event, ignoring any values and rethrowing any exception.
|
T |
single() |
T |
single(T defaultValue) |
void |
subscribe()
Runs the source observable to a terminal event, ignoring any values and rethrowing any exception.
|
void |
subscribe(Consumer<? super T> onNext)
Subscribes to the source and calls the given action on the current thread and rethrows any exception wrapped
into OnErrorNotImplementedException.
|
void |
subscribe(Consumer<? super T> onNext,
Consumer<? super java.lang.Throwable> onError)
Subscribes to the source and calls the given actions on the current thread.
|
void |
subscribe(Consumer<? super T> onNext,
Consumer<? super java.lang.Throwable> onError,
java.lang.Runnable onComplete)
Subscribes to the source and calls the given actions on the current thread.
|
void |
subscribe(NbpObservable.NbpSubscriber<? super T> subscriber)
Subscribes to the source and calls the Subscriber methods on the current thread.
|
java.util.concurrent.Future<T> |
toFuture() |
protected NbpBlockingObservable(NbpObservable<? extends T> source)
public static <T> NbpBlockingObservable<T> from(NbpObservable<? extends T> source)
public java.util.Iterator<T> iterator()
iterator in interface java.lang.Iterable<T>public T first()
public T last()
public T single()
public java.lang.Iterable<T> next()
public java.lang.Iterable<T> latest()
public java.util.concurrent.Future<T> toFuture()
public void run()
public void subscribe(NbpObservable.NbpSubscriber<? super T> subscriber)
The unsubscription and backpressure is composed through.
subscriber - the subscriber to forward events and calls to in the current threadpublic void subscribe()
public void subscribe(Consumer<? super T> onNext)
onNext - the callback action for each source valuepublic void subscribe(Consumer<? super T> onNext, Consumer<? super java.lang.Throwable> onError)
onNext - the callback action for each source valueonError - the callback action for an error eventpublic void subscribe(Consumer<? super T> onNext, Consumer<? super java.lang.Throwable> onError, java.lang.Runnable onComplete)
onNext - the callback action for each source valueonError - the callback action for an error eventonComplete - the callback action for the completion event.