Returns the first item emitted by a specified Observable, or
NoSuchElementException
if source contains no elements.
Returns the first item emitted by a specified Observable, or
NoSuchElementException
if source contains no elements.
the first item emitted by the source Observable
java.util.NoSuchElementException
if source contains no elements
Invoke a method on each item emitted by the Observable; block until the Observable completes.
Invoke a method on each item emitted by the Observable; block until the Observable completes.
NOTE: This will block even if the Observable is asynchronous.
This is similar to Observable.subscribe()*, but it blocks. Because it blocks it does not need the Observer.onCompleted or Observer.onError methods.
the action to invoke for every item emitted by the Observable
java.lang.RuntimeException
if an error occurs
Returns the first item emitted by a specified Observable, or
NoSuchElementException
if source contains no elements.
Returns the first item emitted by a specified Observable, or
NoSuchElementException
if source contains no elements.
the first item emitted by the source Observable
java.util.NoSuchElementException
if source contains no elements
Returns an Option
with the very first item emitted by the source Observable,
or None
if the source Observable is empty.
Returns an Option
with the very first item emitted by the source Observable,
or None
if the source Observable is empty.
an Option
with the very first item from the source,
or None
if the source Observable completes without emitting any item.
Returns the very first item emitted by the source Observable, or a default value if the source Observable is empty.
Returns the very first item emitted by the source Observable, or a default value if the source Observable is empty.
The default value to emit if the source Observable doesn't emit anything. This is a by-name parameter, so it is only evaluated if the source Observable doesn't emit anything.
the very first item from the source, or a default value if the source Observable completes without emitting any item.
Returns the last item emitted by a specified Observable, or
throws NoSuchElementException
if it emits no items.
Returns the last item emitted by a specified Observable, or
throws NoSuchElementException
if it emits no items.
the last item emitted by the source Observable
java.util.NoSuchElementException
if source contains no elements
Returns an Option
with the last item emitted by the source Observable,
or None
if the source Observable completes without emitting any items.
Returns an Option
with the last item emitted by the source Observable,
or None
if the source Observable completes without emitting any items.
an Option
with the last item emitted by the source Observable,
or None
if the source Observable is empty
Returns the last item emitted by the source Observable, or a default item if the source Observable completes without emitting any items.
Returns the last item emitted by the source Observable, or a default item if the source Observable completes without emitting any items.
the default item to emit if the source Observable is empty. This is a by-name parameter, so it is only evaluated if the source Observable doesn't emit anything.
the last item emitted by the source Observable, or a default item if the source Observable is empty
Returns an Iterable
that returns the latest item emitted by this BlockingObservable
,
waiting if necessary for one to become available.
Returns an Iterable
that returns the latest item emitted by this BlockingObservable
,
waiting if necessary for one to become available.
If this BlockingObservable
produces items faster than Iterator.next
takes them,
onNext
events might be skipped, but onError
or onCompleted
events are not.
Note also that an onNext
directly followed by onCompleted
might hide the onNext
event.
an Iterable
that always returns the latest item emitted by this BlockingObservable
Returns an Iterable
that always returns the item most recently emitted by an Observable.
Returns an Iterable
that always returns the item most recently emitted by an Observable.
the initial value that will be yielded by the Iterable
sequence if the Observable has not yet emitted an item
an Iterable
that on each iteration returns the item that the Observable has most recently emitted
Returns an Iterable
that blocks until the Observable emits another item,
then returns that item.
Returns an Iterable
that blocks until the Observable emits another item,
then returns that item.
an Iterable
that blocks upon each iteration until the Observable emits a new item, whereupon the Iterable returns that item
If the source Observable completes after emitting a single item, return that item.
If the source Observable completes after emitting a single item, return that item. If the source Observable
emits more than one item or no items, notify of an IllegalArgumentException
or NoSuchElementException
respectively.
an Observable that emits the single item emitted by the source Observable
java.lang.IllegalArgumentException
if the source emits more than one item
java.util.NoSuchElementException
if the source emits no items
If the source Observable completes after emitting a single item, return an Option
with that item;
if the source Observable is empty, return None
.
If the source Observable completes after emitting a single item, return an Option
with that item;
if the source Observable is empty, return None
. If the source Observable emits more than one item,
throw an IllegalArgumentException
.
an Option
with the single item emitted by the source Observable, or
None
if the source Observable is empty
java.lang.IllegalArgumentException
if the source Observable emits more than one item
If the source Observable completes after emitting a single item, return that item; if the source Observable is empty, return a default item.
If the source Observable completes after emitting a single item, return that item;
if the source Observable is empty, return a default item. If the source Observable
emits more than one item, throw an IllegalArgumentException
.
a default value to emit if the source Observable emits no item. This is a by-name parameter, so it is only evaluated if the source Observable doesn't emit anything.
the single item emitted by the source Observable, or a default item if the source Observable is empty
java.lang.IllegalArgumentException
if the source Observable emits more than one item
EXPERIMENTAL Subscribes to the source and calls the Subscriber methods on the current thread.
EXPERIMENTAL Subscribes to the source and calls the Subscriber methods on the current thread.
The unsubscription and backpressure is composed through.
the Subscriber to forward events and calls to in the current thread
EXPERIMENTAL Subscribes to the source and calls back the Observer methods on the current thread.
EXPERIMENTAL Subscribes to the source and calls the given functions on the current thread.
EXPERIMENTAL Subscribes to the source and calls the given functions on the current thread.
this function will be called whenever the Observable emits an item
this function will be called if an error occurs
this function will be called when this Observable has finished emitting items
EXPERIMENTAL Subscribes to the source and calls the given functions on the current thread.
EXPERIMENTAL Subscribes to the source and calls the given functions on the current thread.
this function will be called whenever the Observable emits an item
this function will be called if an error occurs
EXPERIMENTAL Subscribes to the source and calls the given functions on the current thread, or rethrows any exception wrapped into rx.exceptions.OnErrorNotImplementedException.
EXPERIMENTAL Subscribes to the source and calls the given functions on the current thread, or rethrows any exception wrapped into rx.exceptions.OnErrorNotImplementedException.
this function will be called whenever the Observable emits an item
EXPERIMENTAL Runs the source observable to a terminal event, ignoring any values and rethrowing any exception.
EXPERIMENTAL Runs the source observable to a terminal event, ignoring any values and rethrowing any exception.
Returns a Future
representing the single value emitted by this BlockingObservable
.
Returns a Future
representing the single value emitted by this BlockingObservable
.
The returned Future
will be completed with an IllegalArgumentException
if the BlockingObservable
emits more than one item. And it will be completed with an NoSuchElementException
if the BlockingObservable
is empty. Use Observable.toSeq.toBlocking.toFuture
if you are not sure about the size of BlockingObservable
and do not want to handle these Exception
s.
a Future
that expects a single item to be emitted by this BlockingObservable
.
Returns an Iterable
that iterates over all items emitted by this Observable.
Returns a List
that contains all items emitted by this Observable.
An Observable that provides blocking operators.
You can obtain a BlockingObservable from an Observable using rx.lang.scala.Observable.toBlocking