Returns an Observable that first emits the items emitted by this
, and then the items emitted
by that
.
Returns an Observable that first emits the items emitted by this
, and then the items emitted
by that
.
an Observable to be appended
an Observable that emits items that are the result of combining the items emitted by this and that, one after the other
Returns an Observable that emits a specified item before it begins to emit items emitted by the source Observable.
Returns an Observable that emits a specified item before it begins to emit items emitted by the source Observable.
the item to emit
an Observable that emits the specified item before it begins to emit items emitted by the source Observable
Returns an Observable that first emits the items emitted by this
, and then elem
.
Returns an Observable that first emits the items emitted by this
, and then elem
.
the item to be appended
an Observable that first emits the items emitted by this
, and then elem
.
Given two Observables, mirror the one that first emits an item.
Given two Observables, mirror the one that first emits an item.
an Observable competing to react first
an Observable that emits the same sequence of items as whichever of this
or that
first emitted an item.
Call this method to subscribe an Subscriber for receiving items and notifications from the Observable.
Call this method to subscribe an Subscriber for receiving items and notifications from the Observable.
A typical implementation of subscribe
does the following:
It stores a reference to the Observer in a collection object, such as a List[T]
object.
It returns a reference to the rx.lang.scala.Subscription interface. This enables Subscribers to unsubscribe, that is, to stop receiving items and notifications before the Observable stops sending them, which also invokes the Subscriber's onCompleted method.
An Observable instance is responsible for accepting all subscriptions and notifying all Subscribers. Unless the documentation for a particular Observable implementation indicates otherwise, Subscribers should make no assumptions about the order in which multiple Subscribers will receive their notifications.
This method does not operate by default on a particular Scheduler.
the Subscriber
a rx.lang.scala.Subscription reference whose unsubscribe
method can be called to stop receiving items
before the Observable has finished sending them
Call this method to subscribe an rx.lang.scala.Observer for receiving items and notifications from the Observable.
Call this method to subscribe an rx.lang.scala.Observer for receiving items and notifications from the Observable.
A typical implementation of subscribe
does the following:
It stores a reference to the Observer in a collection object, such as a List[T]
object.
It returns a reference to the rx.lang.scala.Subscription interface. This enables Observers to unsubscribe, that is, to stop receiving items and notifications before the Observable stops sending them, which also invokes the Observer's onCompleted method.
An Observable[T]
instance is responsible for accepting all subscriptions
and notifying all Observers. Unless the documentation for a particular
Observable[T]
implementation indicates otherwise, Observers should make no
assumptions about the order in which multiple Observers will receive their notifications.
This method does not operate by default on a particular Scheduler.
the observer
a rx.lang.scala.Subscription reference whose unsubscribe
method can be called to stop receiving items
before the Observable has finished sending them
This method has similar behavior to Observable.replay
except that this auto-subscribes to
the source Observable rather than returning a start function and an Observable.
This method has similar behavior to Observable.replay
except that this auto-subscribes to
the source Observable rather than returning a start function and an Observable.
This is useful when you want an Observable to cache responses and you can't control the subscribe/unsubscribe behavior of all the rx.lang.scala.Observers.
When you call cache
, it does not yet subscribe to the
source Observable. This only happens when subscribe
is called
the first time on the Observable returned by cache
.
Note: You sacrifice the ability to unsubscribe from the origin when you use the
cache()
operator so be careful not to use this operator on Observables that
emit an infinite or very large number of items that will use up memory.
an Observable that when first subscribed to, caches all of its notifications for the benefit of subsequent subscribers.
Caches emissions from the source Observable and replays them in order to any subsequent Subscribers.
Caches emissions from the source Observable and replays them in order to any subsequent Subscribers. This method has similar behavior to replay except that this auto-subscribes to the source Observable rather than returning a ConnectableObservable for which you must call connect to activate the subscription.
This is useful when you want an Observable to cache responses and you can't control the subscribe/unsubscribe behavior of all the Subscribers.
When you call this method, it does not yet subscribe to the source Observable and so does not yet
begin caching items. This only happens when the first Subscriber calls the resulting Observable's subscribe
method.
**Note:** You sacrifice the ability to unsubscribe from the origin when you use the this method. So be careful not to use this method on Observables that emit an infinite or very large number of items that will use up memory.
This operator does not support upstream backpressure as it is purposefully requesting and caching everything emitted.
This method does not operate by default on a particular Scheduler.
**Note:** The capacity
hint is not an upper bound on cache size. For that, consider
replay(Int) in combination with
ConnectableObservable.autoConnect or similar.
hint for number of items to cache (for optimizing underlying data structure)
an Observable that, when first subscribed to, caches all of its items and notifications for the benefit of subsequent Subscribers
Return a new Observable by applying a partial function to all elements of this Observable on which the function is defined.
Return a new Observable by applying a partial function to all elements of this Observable on which the function is defined.
the element type of the returned Observable.
the partial function which filters and maps the Observable.
a new Observable by applying a partial function to all elements of this Observable on which the function is defined.
Combines two observables, emitting a pair of the latest values of each of the source observables each time an event is received from one of the source observables.
Combines two observables, emitting a pair of the latest values of each of the source observables each time an event is received from one of the source observables.
The second source observable.
An Observable that combines the source Observables
Combines two observables, emitting some type R
specified in the function selector
,
each time an event is received from one of the source observables, where the aggregation
is defined by the given function.
Combines two observables, emitting some type R
specified in the function selector
,
each time an event is received from one of the source observables, where the aggregation
is defined by the given function.
The second source observable.
The function that is used combine the emissions of the two observables.
An Observable that combines the source Observables according to the function selector
.
[use case]
EXPERIMENTAL Concatenates an Observable sequence of Observables eagerly into a single stream of values.
EXPERIMENTAL Concatenates an Observable sequence of Observables eagerly into a single stream of values.
Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the emitted source Observables as they are observed. The operator buffers the values emitted by these Observables and then drains them in order, each one after the previous one completes.
Backpressure is honored towards the downstream, however, due to the eagerness requirement, sources are subscribed to in unbounded mode and their values are queued up in an unbounded buffer.
This method does not operate by default on a particular Scheduler.
hints about the number of expected values in an Observable
an Observable that emits items all of the items emitted by the Observables emitted by
this
, one after the other, without interleaving them
(if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
EXPERIMENTAL Concatenates an Observable sequence of Observables eagerly into a single stream of values.
EXPERIMENTAL Concatenates an Observable sequence of Observables eagerly into a single stream of values.
Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the emitted source Observables as they are observed. The operator buffers the values emitted by these Observables and then drains them in order, each one after the previous one completes.
Backpressure is honored towards the downstream, however, due to the eagerness requirement, sources are subscribed to in unbounded mode and their values are queued up in an unbounded buffer.
This method does not operate by default on a particular Scheduler.
an Observable that emits items all of the items emitted by the Observables emitted by
this
, one after the other, without interleaving them
(if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
EXPERIMENTAL
Concatenates this
and that
source Observables eagerly into a single stream of values.
EXPERIMENTAL
Concatenates this
and that
source Observables eagerly into a single stream of values.
Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the source Observables. The operator buffers the values emitted by these Observables and then drains them in order, each one after the previous one completes.
Backpressure is honored towards the downstream, however, due to the eagerness requirement, sources are subscribed to in unbounded mode and their values are queued up in an unbounded buffer.
This method does not operate by default on a particular Scheduler.
the source to concat with.
an Observable that emits items all of the items emitted by this
and that
, one after the other,
without interleaving them.
(if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
Returns a new Observable that emits items resulting from applying a function that you supply to each item emitted by the source Observable, where that function returns an Observable, and then emitting the items that result from concatenating those resulting Observables.
Returns a new Observable that emits items resulting from applying a function that you supply to each item emitted by the source Observable, where that function returns an Observable, and then emitting the items that result from concatenating those resulting Observables.
a function that, when applied to an item emitted by the source Observable, returns an Observable
an Observable that emits the result of applying the transformation function to each item emitted by the source Observable and concatenating the Observables obtained from this transformation
EXPERIMENTAL Maps a sequence of values into Observables and concatenates these Observables eagerly into a single Observable.
EXPERIMENTAL Maps a sequence of values into Observables and concatenates these Observables eagerly into a single Observable.
Eager concatenation means that once a Subscriber subscribes, this operator subscribes to all of the source Observables. The operator buffers the values emitted by these Observables and then drains them in order, each one after the previous one completes.
Backpressure is honored towards the downstream, however, due to the eagerness requirement, sources are subscribed to in unbounded mode and their values are queued up in an unbounded buffer.
This method does not operate by default on a particular Scheduler.
hints about the number of expected source sequence values
the maximum number of concurrent subscribed Observables
the function that maps a sequence of values into a sequence of Observables that will be eagerly concatenated
an Observable that emits items all of the items emitted by the Observables returned by
f
, one after the other, without interleaving them
EXPERIMENTAL Maps a sequence of values into Observables and concatenates these Observables eagerly into a single Observable.
EXPERIMENTAL Maps a sequence of values into Observables and concatenates these Observables eagerly into a single Observable.
Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the source Observables. The operator buffers the values emitted by these Observables and then drains them in order, each one after the previous one completes.
Backpressure is honored towards the downstream, however, due to the eagerness requirement, sources are subscribed to in unbounded mode and their values are queued up in an unbounded buffer.
This method does not operate by default on a particular Scheduler.
hints about the number of expected values in an Observable
the function that maps a sequence of values into a sequence of Observables that will be eagerly concatenated
an Observable that emits items all of the items emitted by the Observables returned by
f
, one after the other, without interleaving them
(if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
EXPERIMENTAL Maps a sequence of values into Observables and concatenates these Observables eagerly into a single Observable.
EXPERIMENTAL Maps a sequence of values into Observables and concatenates these Observables eagerly into a single Observable.
Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the source Observables. The operator buffers the values emitted by these Observables and then drains them in order, each one after the previous one completes.
Backpressure is honored towards the downstream, however, due to the eagerness requirement, sources are subscribed to in unbounded mode and their values are queued up in an unbounded buffer.
This method does not operate by default on a particular Scheduler.
the function that maps a sequence of values into a sequence of Observables that will be eagerly concatenated
an Observable that emits items all of the items emitted by the Observables returned by
f
, one after the other, without interleaving them
(if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
Returns an Observable that emits a Boolean that indicates whether the source Observable emitted a specified item.
Returns an Observable that emits a Boolean that indicates whether the source Observable emitted a specified item.
Note: this method uses ==
to compare elements. It's a bit different from RxJava which uses Object.equals
.
the item to search for in the emissions from the source Observable
an Observable that emits true
if the specified item is emitted by the source Observable,
or false
if the source Observable completes without emitting that item
Return an Observable which emits the number of elements in the source Observable which satisfy a predicate.
Return an Observable which emits the number of elements in the source Observable which satisfy a predicate.
the predicate used to test elements.
an Observable which emits the number of elements in the source Observable which satisfy a predicate.
Returns an Observable that counts the total number of items emitted by the source Observable and emits this count as a 64-bit Long.
Returns an Observable that counts the total number of items emitted by the source Observable and emits this count as a 64-bit Long.
<dl> <dt>Backpressure Support:</dt>
an Observable that emits a single item: the number of items emitted by the source Observable as a 64-bit Long item
#count()
Debounces by dropping all values that are followed by newer values before the timeout value expires.
Debounces by dropping all values that are followed by newer values before the timeout value expires. The timer resets on each onNext
call.
NOTE: If events keep firing faster than the timeout then no data will be emitted.
Information on debounce vs throttle:
The time each value has to be 'the most recent' of the rx.lang.scala.Observable to ensure that it's not dropped.
The rx.lang.scala.Scheduler to use internally to manage the timers which handle timeout for each event.
Observable which performs the throttle operation.
Observable.throttleWithTimeout
Debounces by dropping all values that are followed by newer values before the timeout value expires.
Debounces by dropping all values that are followed by newer values before the timeout value expires. The timer resets on each onNext
call.
NOTE: If events keep firing faster than the timeout then no data will be emitted.
Information on debounce vs throttle:
The time each value has to be 'the most recent' of the rx.lang.scala.Observable to ensure that it's not dropped.
An rx.lang.scala.Observable which filters out values which are too quickly followed up with newer values.
Observable.throttleWithTimeout
Return an Observable that mirrors the source Observable, except that it drops items emitted by the source Observable that are followed by another item within a computed debounce duration.
Return an Observable that mirrors the source Observable, except that it drops items emitted by the source Observable that are followed by another item within a computed debounce duration.
function to retrieve a sequence that indicates the throttle duration for each item
an Observable that omits items emitted by the source Observable that are followed by another item within a computed debounce duration
Returns an Observable that delays the subscription to and emissions from the souce Observable via another Observable on a per-item basis.
Returns an Observable that delays the subscription to and emissions from the souce Observable via another Observable on a per-item basis.
Note: the resulting Observable will immediately propagate any onError
notification
from the source Observable.
a function that returns an Observable that triggers the subscription to the source Observable once it emits any item
a function that returns an Observable for each item emitted by the source Observable, which is
then used to delay the emission of that item by the resulting Observable until the Observable
returned from itemDelay
emits an item
an Observable that delays the subscription and emissions of the source Observable via another Observable on a per-item basis
Returns an Observable that delays the emissions of the source Observable via another Observable on a per-item basis.
Returns an Observable that delays the emissions of the source Observable via another Observable on a per-item basis.
Note: the resulting Observable will immediately propagate any onError
notification
from the source Observable.
a function that returns an Observable for each item emitted by the source Observable, which is
then used to delay the emission of that item by the resulting Observable until the Observable
returned from itemDelay
emits an item
an Observable that delays the emissions of the source Observable via another Observable on a per-item basis
Returns an Observable that emits the items emitted by the source Observable shifted forward in time by a specified delay.
Returns an Observable that emits the items emitted by the source Observable shifted forward in time by a specified delay. Error notifications from the source Observable are not delayed.
the delay to shift the source by
the Scheduler to use for delaying
the source Observable shifted in time by the specified delay
Returns an Observable that emits the items emitted by the source Observable shifted forward in time by a specified delay.
Returns an Observable that emits the items emitted by the source Observable shifted forward in time by a specified delay. Error notifications from the source Observable are not delayed.
the delay to shift the source by
the source Observable shifted in time by the specified delay
EXPERIMENTAL Converts an Observable into a ErrorDelayingObservable that provides operators which delay errors when composing multiple Observables.
EXPERIMENTAL Converts an Observable into a ErrorDelayingObservable that provides operators which delay errors when composing multiple Observables.
Returns an Observable that delays the subscription to the source Observable until a second Observable emits an item.
Returns an Observable that delays the subscription to the source Observable until a second Observable emits an item.
<dl> <dt>Scheduler:</dt>
a function that returns an Observable that triggers the subscription to the source Observable once it emits any item
an Observable that delays the subscription to the source Observable until the Observable returned
by subscriptionDelay
emits an item
Return an Observable that delays the subscription to the source Observable by a given amount of time, both waiting and subscribing on a given Scheduler.
Return an Observable that delays the subscription to the source Observable by a given amount of time, both waiting and subscribing on a given Scheduler.
the time to delay the subscription
the Scheduler on which the waiting and subscription will happen
an Observable that delays the subscription to the source Observable by a given amount, waiting and subscribing on the given Scheduler
Return an Observable that delays the subscription to the source Observable by a given amount of time.
Return an Observable that delays the subscription to the source Observable by a given amount of time.
the time to delay the subscription
an Observable that delays the subscription to the source Observable by the given amount
[use case] Returns an Observable that reverses the effect of rx.lang.scala.Observable.materialize by transforming the rx.lang.scala.Notification objects emitted by the source Observable into the items or notifications they represent.
Returns an Observable that reverses the effect of rx.lang.scala.Observable.materialize by transforming the rx.lang.scala.Notification objects emitted by the source Observable into the items or notifications they represent.
This operation is only available if this
is of type Observable[Notification[U]]
for some U
,
otherwise you will get a compilation error.
an Observable that emits the items and notifications embedded in the rx.lang.scala.Notification objects emitted by the source Observable
Returns an Observable that forwards all items emitted from the source Observable that are distinct according to a key selector function.
Returns an Observable that forwards all items emitted from the source Observable that are distinct according to a key selector function.
a function that projects an emitted item to a key value which is used for deciding whether an item is distinct from another one or not
an Observable of distinct items
Returns an Observable that forwards all distinct items emitted from the source Observable.
Returns an Observable that forwards all distinct items emitted from the source Observable.
an Observable of distinct items
Returns an Observable that forwards all items emitted from the source Observable that are sequentially distinct according to a key selector function.
Returns an Observable that forwards all items emitted from the source Observable that are sequentially distinct according to a key selector function.
a function that projects an emitted item to a key value which is used for deciding whether an item is sequentially distinct from another one or not
an Observable of sequentially distinct items
Returns an Observable that forwards all sequentially distinct items emitted from the source Observable.
Returns an Observable that forwards all sequentially distinct items emitted from the source Observable.
an Observable of sequentially distinct items
Registers an function to be called when this Observable invokes either onCompleted or onError.
Registers an function to be called when this Observable invokes either onCompleted or onError.
This method does not operate by default on a particular Scheduler.
an function to be invoked when the source Observable finishes
an Observable that emits the same items as the source Observable, then invokes the action
Invokes an action when the source Observable calls onCompleted
.
Invokes an action when the source Observable calls onCompleted
.
the action to invoke when the source Observable calls
onCompleted
the source Observable with the side-effecting behavior applied
Returns an Observable that applies the given function to each item emitted by an Observable.
Returns an Observable that applies the given function to each item emitted by an Observable.
this function will be called whenever the Observable emits an item
this function will be called if an error occurs
the action to invoke when the source Observable calls
an Observable with the side-effecting behavior applied.
Returns an Observable that applies the given function to each item emitted by an Observable.
Returns an Observable that applies the given function to each item emitted by an Observable.
this function will be called whenever the Observable emits an item
this function will be called if an error occurs
an Observable with the side-effecting behavior applied.
Returns an Observable that applies the given function to each item emitted by an Observable.
Returns an Observable that applies the given function to each item emitted by an Observable.
this function will be called whenever the Observable emits an item
an Observable with the side-effecting behavior applied.
Returns an Observable that applies the given function to each item emitted by an Observable.
Returns an Observable that applies the given function to each item emitted by an Observable.
the observer
an Observable with the side-effecting behavior applied.
Invokes an action if the source Observable calls onError
.
Invokes an action if the source Observable calls onError
.
the action to invoke if the source Observable calls
onError
the source Observable with the side-effecting behavior applied
Invokes an action when the source Observable calls onNext
.
Invokes an action when the source Observable calls onNext
.
the action to invoke when the source Observable calls onNext
the source Observable with the side-effecting behavior applied
BETA An Observable wrapping the source one that will invokes the given action when it receives a request for more items.
BETA An Observable wrapping the source one that will invokes the given action when it receives a request for more items.
This method does not operate by default on a particular Scheduler.
the action that gets called when an Observer requests items from this Observable
an Observable that will call onRequest
when appropriate
(if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
Modifies the source Observable
so that it invokes the given action when it is subscribed from
its subscribers.
Modifies the source Observable
so that it invokes the given action when it is subscribed from
its subscribers. Each subscription will result in an invocation of the given action except when the
source Observable
is reference counted, in which case the source Observable
will invoke
the given action for the first subscription.
<dl> <dt>Scheduler:</dt>
the action that gets called when an observer subscribes to this Observable
the source Observable
modified so as to call this Action when appropriate
0.20
Modifies an Observable so that it invokes an action when it calls onCompleted
or onError
.
Modifies an Observable so that it invokes an action when it calls onCompleted
or onError
.
This differs from doAfterTerminate in that this happens **before** onCompleted/onError are emitted.
the action to invoke when the source Observable calls onCompleted
or onError
the source Observable with the side-effecting behavior applied
Modifies the source Observable
so that it invokes the given action when it is unsubscribed from
its subscribers.
Modifies the source Observable
so that it invokes the given action when it is unsubscribed from
its subscribers. Each un-subscription will result in an invocation of the given action except when the
source Observable
is reference counted, in which case the source Observable
will invoke
the given action for the very last un-subscription.
<dl> <dt>Scheduler:</dt>
the action that gets called when this Observable
is unsubscribed
the source Observable
modified so as to call this Action when appropriate
0.20
Returns an Observable that drops values emitted by the source Observable before a specified time window elapses.
Returns an Observable that drops values emitted by the source Observable before a specified time window elapses.
the length of the time window to drop
the Scheduler
on which the timed wait happens
an Observable that drops values emitted by the source Observable before the time window defined
by time
elapses and emits the remainder
Returns an Observable that drops values emitted by the source Observable before a specified time window elapses.
Returns an Observable that drops values emitted by the source Observable before a specified time window elapses.
the length of the time window to drop
an Observable that drops values emitted by the source Observable before the time window defined
by time
elapses and emits the remainder
Returns an Observable that skips the first num
items emitted by the source
Observable and emits the remainder.
Returns an Observable that skips the first num
items emitted by the source
Observable and emits the remainder.
the number of items to skip
an Observable that is identical to the source Observable except that it does not
emit the first num
items that the source emits
Returns an Observable that drops items emitted by the source Observable during a specified time window (defined on a specified scheduler) before the source completes.
Returns an Observable that drops items emitted by the source Observable during a specified time window (defined on a specified scheduler) before the source completes.
Note: this action will cache the latest items arriving in the specified time window.
the length of the time window
the scheduler used as the time source
an Observable that drops those items emitted by the source Observable in a time window before the
source completes defined by time
and scheduler
Returns an Observable that drops items emitted by the source Observable during a specified time window before the source completes.
Returns an Observable that drops items emitted by the source Observable during a specified time window before the source completes.
Note: this action will cache the latest items arriving in the specified time window.
the length of the time window
an Observable that drops those items emitted by the source Observable in a time window before the
source completes defined by time
Returns an Observable that drops a specified number of items from the end of the sequence emitted by the source Observable.
Returns an Observable that drops a specified number of items from the end of the sequence emitted by the source Observable.
This Observer accumulates a queue long enough to store the first n
items. As more items are
received, items are taken from the front of the queue and emitted by the returned Observable. This causes
such items to be delayed.
number of items to drop from the end of the source sequence
an Observable that emits the items emitted by the source Observable except for the dropped ones at the end
java.lang.IndexOutOfBoundsException
if n
is less than zero
Returns an Observable that skips items emitted by the source Observable until a second Observable emits an item.
Returns an Observable that skips items emitted by the source Observable until a second Observable emits an item.
the second Observable that has to emit an item before the source Observable's elements begin to be mirrored by the resulting Observable
an Observable that skips items from the source Observable until the second Observable emits an item, then emits the remaining items
Returns an Observable that bypasses all items from the source Observable as long as the specified condition holds true.
Returns an Observable that bypasses all items from the source Observable as long as the specified condition holds true. Emits all further source items as soon as the condition becomes false.
A function to test each item emitted from the source Observable for a condition.
an Observable that emits all items from the source Observable as soon as the condition becomes false.
Returns an Observable that emits the single item at a specified index in a sequence of emissions from a source Observbable.
Returns an Observable that emits the single item at a specified index in a sequence of emissions from a source Observbable.
the zero-based index of the item to retrieve
an Observable that emits a single item: the item at the specified position in the sequence of those emitted by the source Observable
java.lang.IndexOutOfBoundsException
if index is greater than or equal to the number of items emitted by the source
Observable, or index is less than 0
Returns an Observable that emits the item found at a specified index in a sequence of emissions from a source Observable, or a default item if that index is out of range.
Returns an Observable that emits the item found at a specified index in a sequence of emissions from a source Observable, or a default item if that index is out of range.
the zero-based index of the item to retrieve
the default item
an Observable that emits the item at the specified position in the sequence emitted by the source Observable, or the default item if that index is outside the bounds of the source sequence
java.lang.IndexOutOfBoundsException
if index
is less than 0
Tests whether a predicate holds for some of the elements of this Observable
.
Tests whether a predicate holds for some of the elements of this Observable
.
the predicate used to test elements.
an Observable emitting one single Boolean, which is true
if the given predicate p
holds for some of the elements of this Observable, and false
otherwise.
Returns an Observable which only emits those items for which a given predicate holds.
Returns an Observable which only emits those items for which a given predicate holds.
a function that evaluates the items emitted by the source Observable, returning true
if they pass the filter
an Observable that emits only those items in the original Observable that the filter
evaluates as true
Returns an Observable which only emits elements which do not satisfy a predicate.
Returns an Observable which only emits elements which do not satisfy a predicate.
the predicate used to test elements.
Returns an Observable which only emits elements which do not satisfy a predicate.
Returns an Observable that emits only the very first item emitted by the source Observable, or raises an
NoSuchElementException
if the source Observable is empty.
Returns an Observable that emits only the very first item emitted by the source Observable, or raises an
NoSuchElementException
if the source Observable is empty.
an Observable that emits only the very first item emitted by the source Observable, or raises an
NoSuchElementException
if the source Observable is empty
"MSDN: Observable.firstAsync()"
Returns an Observable that emits only the very first item emitted by the source Observable, or a default value if the source Observable is empty.
Returns an Observable that emits only 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.
an Observable that emits only the very first item from the source, or a default value if the source Observable completes without emitting any item.
BETA Returns an Observable that applies a function to each item emitted or notification raised by the source Observable and then flattens the Observable s returned from these functions and emits the resulting items, while limiting the maximum number of concurrent subscriptions to these Observables.
BETA Returns an Observable that applies a function to each item emitted or notification raised by the source Observable and then flattens the Observable s returned from these functions and emits the resulting items, while limiting the maximum number of concurrent subscriptions to these Observables.
This method does not operate by default on a particular Scheduler.
the maximum number of Observables that may be subscribed to concurrently
a function that returns an Observable to merge for each item emitted by the source Observable
a function that returns an Observable to merge for an onError notification from the source Observable
a function that returns an Observable to merge for an onCompleted notification from the source Observable
an Observable that emits the results of merging the Observables returned from applying the specified functions to the emissions and notifications of the source Observable
(if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
Returns an Observable that applies a function to each item emitted or notification raised by the source Observable and then flattens the Observables returned from these functions and emits the resulting items.
Returns an Observable that applies a function to each item emitted or notification raised by the source Observable and then flattens the Observables returned from these functions and emits the resulting items.
the result type
a function that returns an Observable to merge for each item emitted by the source Observable
a function that returns an Observable to merge for an onError notification from the source Observable
a function that returns an Observable to merge for an onCompleted notification from the source Observable
an Observable that emits the results of merging the Observables returned from applying the specified functions to the emissions and notifications of the source Observable
BETA Returns an Observable that emits items based on applying a function that you supply to each item emitted by the source Observable , where that function returns an Observable , and then merging those resulting Observables and emitting the results of this merger, while limiting the maximum number of concurrent subscriptions to these Observables.
BETA Returns an Observable that emits items based on applying a function that you supply to each item emitted by the source Observable , where that function returns an Observable , and then merging those resulting Observables and emitting the results of this merger, while limiting the maximum number of concurrent subscriptions to these Observables.
$$noDefaultScheduler
the maximum number of Observables that may be subscribed to concurrently
a function that, when applied to an item emitted by the source Observable, returns an Observable
an Observable that emits the result of applying the transformation function to each item emitted by the source Observable and merging the results of the Observables obtained from this transformation
(if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
Creates a new Observable by applying a function that you supply to each item emitted by the source Observable, where that function returns an Observable, and then merging those resulting Observables and emitting the results of this merger.
Creates a new Observable by applying a function that you supply to each item emitted by the source Observable, where that function returns an Observable, and then merging those resulting Observables and emitting the results of this merger.
a function that, when applied to an item emitted by the source Observable, returns an Observable
an Observable that emits the result of applying the transformation function to each item emitted by the source Observable and merging the results of the Observables obtained from this transformation.
Returns an Observable that merges each item emitted by the source Observable with the values in an Iterable corresponding to that item that is generated by a selector.
Returns an Observable that merges each item emitted by the source Observable with the values in an Iterable corresponding to that item that is generated by a selector.
the type of item emitted by the resulting Observable
a function that returns an Iterable sequence of values for when given an item emitted by the source Observable
an Observable that emits the results of merging the items emitted by the source Observable with
the values in the Iterables corresponding to those items, as generated by collectionSelector
Returns an Observable that emits the results of applying a function to the pair of values from the source Observable and an Iterable corresponding to that item that is generated by a selector.
Returns an Observable that emits the results of applying a function to the pair of values from the source Observable and an Iterable corresponding to that item that is generated by a selector.
the collection element type
the type of item emited by the resulting Observable
a function that returns an Iterable sequence of values for each item emitted by the source Observable
a function that returns an item based on the item emitted by the source Observable and the
Iterable returned for that item by the collectionSelector
an Observable that emits the items returned by resultSelector
for each item in the source Observable
BETA Returns an Observable that emits the results of a specified function to the pair of values emitted by the source Observable and a specified collection Observable.
BETA Returns an Observable that emits the results of a specified function to the pair of values emitted by the source Observable and a specified collection Observable.
the type of items emitted by the collection Observable
the type of items emitted by the resulting Observable
the maximum number of Observables that may be subscribed to concurrently
a function that returns an Observable for each item emitted by the source Observable
a function that combines one item emitted by each of the source and collection Observables and returns an item to be emitted by the resulting Observable
an Observable that emits the results of applying a function to a pair of values emitted by the source Observable and the collection Observable
Returns an Observable that emits the results of a specified function to the pair of values emitted by the source Observable and a specified collection Observable.
Returns an Observable that emits the results of a specified function to the pair of values emitted by the source Observable and a specified collection Observable.
the type of items emitted by the collection Observable
the type of items emitted by the resulting Observable
a function that returns an Observable for each item emitted by the source Observable
a function that combines one item emitted by each of the source and collection Observables and returns an item to be emitted by the resulting Observable
an Observable that emits the results of applying a function to a pair of values emitted by the source Observable and the collection Observable
Flattens an Observable that emits Observables into a single Observable that emits the items emitted by those Observables, without any transformation, while limiting the maximum number of concurrent subscriptions to these Observables.
Flattens an Observable that emits Observables into a single Observable that emits the items emitted by those Observables, without any transformation, while limiting the maximum number of concurrent subscriptions to these Observables.
You can combine the items emitted by multiple Observables so that they appear as a single Observable, by
using the flatten
method.
the maximum number of Observables that may be subscribed to concurrently
an Observable that emits items that are the result of flattening the Observables emitted by the source
Observable
java.lang.IllegalArgumentException
if maxConcurrent
is less than or equal to 0
[use case] Flattens the sequence of Observables emitted by this
into one Observable, without any
transformation.
Flattens the sequence of Observables emitted by this
into one Observable, without any
transformation.
You can combine the items emitted by multiple Observables so that they act like a single Observable by using this method.
This operation is only available if this
is of type Observable[Observable[U]]
for some U
,
otherwise you'll get a compilation error.
an Observable that emits items that are the result of flattening the items emitted
by the Observables emitted by this
Returns an Observable that applies a function of your choosing to the first item emitted by a source Observable, then feeds the result of that function along with the second item emitted by an Observable into the same function, and so on until all items have been emitted by the source Observable, emitting the final result from the final call to your function as its sole item.
Returns an Observable that applies a function of your choosing to the first item emitted by a source Observable, then feeds the result of that function along with the second item emitted by an Observable into the same function, and so on until all items have been emitted by the source Observable, emitting the final result from the final call to your function as its sole item.
This technique, which is called "reduce" or "aggregate" here, is sometimes called "fold,"
"accumulate," "compress," or "inject" in other programming contexts. Groovy, for instance,
has an inject
method that does a similar operation on lists.
the initial (seed) accumulator value
an accumulator function to be invoked on each item emitted by the source Observable, the result of which will be used in the next accumulator call
an Observable that emits a single item that is the result of accumulating the output from the items emitted by the source Observable
Returns an Observable that emits a Boolean that indicates whether all of the items emitted by the source Observable satisfy a condition.
Returns an Observable that emits a Boolean that indicates whether all of the items emitted by the source Observable satisfy a condition.
a function that evaluates an item and returns a Boolean
an Observable that emits true
if all items emitted by the source
Observable satisfy the predicate; otherwise, false
Subscribes to the Observable and receives notifications for each element and the terminal events.
Subscribes to the Observable and receives notifications for each element and the terminal events.
Alias to subscribe(T => Unit, Throwable => Unit, () => Unit)
.
This method does not operate by default on a particular Scheduler.
function to execute for each item.
function to execute when an error is emitted.
function to execute when completion is signalled.
0.19
java.lang.IllegalArgumentException
if onNext
is null, or if onError
is null, or if onComplete
is null
Subscribes to the Observable and receives notifications for each element and error events.
Subscribes to the Observable and receives notifications for each element and error events.
Alias to subscribe(T => Unit, Throwable => Unit)
.
This method does not operate by default on a particular Scheduler.
function to execute for each item.
function to execute when an error is emitted.
0.19
java.lang.IllegalArgumentException
if onNext
is null, or if onError
is null
Subscribes to the Observable and receives notifications for each element.
Subscribes to the Observable and receives notifications for each element.
Alias to subscribe(T => Unit)
.
This method does not operate by default on a particular Scheduler.
function to execute for each item.
0.19
java.lang.IllegalArgumentException
if onNext
is null
rx.exceptions.OnErrorNotImplementedException
if the Observable tries to call onError
Groups the items emitted by an Observable according to a specified criterion, and emits these
grouped items as (key, observable)
pairs.
Groups the items emitted by an Observable according to a specified criterion, and emits these
grouped items as (key, observable)
pairs.
Note: A (key, observable)
will cache the items it is to emit until such time as it
is subscribed to. For this reason, in order to avoid memory leaks, you should not simply ignore those
(key, observable)
pairs that do not concern you. Instead, you can signal to them that they may
discard their buffers by applying an operator like take(0)
to them.
This operator does not support backpressure as splitting a stream effectively turns it into a "hot observable"
and blocking any one group would block the entire parent stream. If you need backpressure on individual groups
then you should use operators such as nBackpressureDrop
or @link #onBackpressureBuffer
.
===Scheduler:===
groupBy` does not operate by default on a particular `Scheduler`.
the key type
the value type
a function that extracts the key for each item
a function that extracts the return element for each item
an Observable that emits (key, observable)
pairs, each of which corresponds to a
unique key value and each of which emits those items from the source Observable that share that
key value
Groups the items emitted by this Observable according to a specified discriminator function.
Groups the items emitted by this Observable according to a specified discriminator function.
the type of keys returned by the discriminator function.
a function that extracts the key from an item
an Observable that emits (key, observable)
pairs, where observable
contains all items for which f
returned key
.
Returns an Observable that correlates two Observables when they overlap in time and groups the results.
Returns an Observable that correlates two Observables when they overlap in time and groups the results.
the other Observable to correlate items from the source Observable with
a function that returns an Observable whose emissions indicate the duration of the values of the source Observable
a function that returns an Observable whose emissions indicate the duration of the values of
the other
Observable
a function that takes an item emitted by each Observable and returns the value to be emitted by the resulting Observable
an Observable that emits items based on combining those items emitted by the source Observables whose durations overlap
Returns an Observable that emits only the very first item emitted by the source Observable, or raises an
NoSuchElementException
if the source Observable is empty.
Returns an Observable that emits only the very first item emitted by the source Observable, or raises an
NoSuchElementException
if the source Observable is empty.
an Observable that emits only the very first item emitted by the source Observable, or raises an
NoSuchElementException
if the source Observable is empty
"MSDN: Observable.firstAsync()"
Returns an Observable that emits only an Option
with the very first item emitted by the source Observable,
or None
if the source Observable is empty.
Returns an Observable that emits only an Option
with the very first item emitted by the source Observable,
or None
if the source Observable is empty.
an Observable that emits only an Option
with the very first item from the source, or None
if the source Observable completes without emitting any item.
Returns an Observable that emits only the very first item emitted by the source Observable, or a default value if the source Observable is empty.
Returns an Observable that emits only 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.
an Observable that emits only the very first item from the source, or a default value if the source Observable completes without emitting any item.
Tests whether this Observable
emits no elements.
Tests whether this Observable
emits no elements.
an Observable emitting one single Boolean, which is true
if this Observable
emits no elements, and false
otherwise.
Correlates the items emitted by two Observables based on overlapping durations.
Correlates the items emitted by two Observables based on overlapping durations.
the second Observable to join items from
a function to select a duration for each item emitted by the source Observable, used to determine overlap
a function to select a duration for each item emitted by the inner Observable, used to determine overlap
a function that computes an item to be emitted by the resulting Observable for any two overlapping items emitted by the two Observables
an Observable that emits items correlating to items emitted by the source Observables that have overlapping durations
Returns an Observable that emits the last item emitted by the source Observable or notifies observers of
an NoSuchElementException
if the source Observable is empty.
Returns an Observable that emits the last item emitted by the source Observable or notifies observers of
an NoSuchElementException
if the source Observable is empty.
an Observable that emits the last item from the source Observable or notifies observers of an error
"MSDN: Observable.lastAsync()"
Returns an Observable that emits only an Option
with the last item emitted by the source Observable,
or None
if the source Observable completes without emitting any items.
Returns an Observable that emits only an Option
with the last item emitted by the source Observable,
or None
if the source Observable completes without emitting any items.
an Observable that emits only an Option
with the last item emitted by the source Observable,
or None
if the source Observable is empty
Returns an Observable that emits only the last item emitted by the source Observable, or a default item if the source Observable completes without emitting any items.
Returns an Observable that emits only 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.
an Observable that emits only the last item emitted by the source Observable, or a default item if the source Observable is empty
Returns an Observable that counts the total number of elements in the source Observable.
Returns an Observable that counts the total number of elements in the source Observable.
an Observable emitting the number of counted elements of the source Observable as its single item.
Lifts a function to the current Observable and returns a new Observable that when subscribed to will pass the values of the current Observable through the Operator function.
Lifts a function to the current Observable and returns a new Observable that when subscribed to will pass the values of the current Observable through the Operator function.
In other words, this allows chaining Observers together on an Observable for acting on the values within the Observable.
observable.map(...).filter(...).take(5).lift(new OperatorA()).lift(new OperatorB(...)).subscribe()
If the operator you are creating is designed to act on the individual items emitted by a source
Observable, use lift
. If your operator is designed to transform the source Observable as a whole
(for instance, by applying a particular set of existing RxJava operators to it) use #compose
.
<dl>
<dt>Scheduler:</dt>
the Operator that implements the Observable-operating function to be applied to the source Observable
an Observable that is the result of applying the lifted Operator to the source Observable
0.17
Returns an Observable that applies the given function to each item emitted by an Observable and emits the result.
Returns an Observable that applies the given function to each item emitted by an Observable and emits the result.
a function to apply to each item emitted by the Observable
an Observable that emits the items from the source Observable, transformed by the given function
Turns all of the notifications from a source Observable into onNext emissions, and marks them with their original notification types within rx.lang.scala.Notification objects.
Turns all of the notifications from a source Observable into onNext emissions, and marks them with their original notification types within rx.lang.scala.Notification objects.
an Observable whose items are the result of materializing the items and notifications of the source Observable
Flattens two Observables into one Observable, without any transformation.
Flattens two Observables into one Observable, without any transformation.
You can combine items emitted by two Observables so that they act like a single
Observable by using the merge
method.
an Observable to be merged
an Observable that emits items from this
and that
until
this
or that
emits onError
or both Observables emit onCompleted
.
Converts the source Observable[T]
into an Observable[Observable[T]]
that emits the source Observable as its single emission.
Converts the source Observable[T]
into an Observable[Observable[T]]
that emits the source Observable as its single emission.
an Observable that emits a single item: the source Observable
Return an Observable emitting one single Boolean
, which is true
if the source Observable emits any element, and false
otherwise.
Return an Observable emitting one single Boolean
, which is true
if the source Observable emits any element, and false
otherwise.
an Observable emitting one single Boolean, which is
true if the source Observable emits any element, and
false otherwise.
Returns an Observable to perform its emissions and notifications on a specified Scheduler
,
asynchronously with a bounded buffer of configurable size and optionally delays onError
notifications.
Returns an Observable to perform its emissions and notifications on a specified Scheduler
,
asynchronously with a bounded buffer of configurable size and optionally delays onError
notifications.
you specify which Scheduler this operator will use
indicates if the onError
notification may not cut ahead of onNext
notification on the other side of the
scheduling boundary. If true a sequence ending in onError will be replayed in the same order as was received from upstream
the size of the buffer
the source Observable modified so that its Observers are notified on the specified Scheduler
REturns an Observable to perform its emissions and notifications on a specified Scheduler, asynchronously with a bounded buffer of configurable size.
REturns an Observable to perform its emissions and notifications on a specified Scheduler, asynchronously with a bounded buffer of configurable size.
Note that onError
notifications will cut ahead of onNext
notifications on the emission thread if Scheduler is truly
asynchronous. If strict event ordering is required, consider using the
Observable.observeOn(scheduler:rx\.lang\.scala\.Scheduler,delayError:Boolean)* overload.
you specify which Scheduler this operator will use
the size of the buffer.
the source Observable modified so that its Observers are notified on the specified Scheduler
Return an Observable to perform its emissions and notifications on a specified Scheduler, asynchronously with a bounded buffer and optionally delays onError notifications.
Return an Observable to perform its emissions and notifications on a specified Scheduler, asynchronously with a bounded buffer and optionally delays onError notifications.
you specify which Scheduler this operator will use
indicates if the onError notification may not cut ahead of onNext notification on the other side of the scheduling boundary. If true a sequence ending in onError will be replayed in the same order as was received from upstream
the source Observable that its Observers are notified on the specified Scheduler
Asynchronously notify rx.lang.scala.Observers on the specified rx.lang.scala.Scheduler.
Asynchronously notify rx.lang.scala.Observers on the specified rx.lang.scala.Scheduler.
the rx.lang.scala.Scheduler to notify rx.lang.scala.Observers on
the source Observable modified so that its rx.lang.scala.Observers are notified on the specified rx.lang.scala.Scheduler
BETA Instructs an Observable that is emitting items faster than its Observer can consume them to buffer up to a given amount of items until they can be emitted.
BETA Instructs an Observable that is emitting items faster than its Observer can consume them to buffer up to
a given amount of items until they can be emitted. The resulting Observable will emit
BufferOverflowException
as soon as the buffer's capacity is exceeded, drop all undelivered
items, unsubscribe from the source, and notify onOverflow
.
This method does not operate by default on a particular Scheduler.
capacity of the internal buffer.
an action to run when the buffer's capacity is exceeded. This is a by-name parameter.
the source Observable modified to buffer items up to the given capacity
(if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
BETA Instructs an Observable that is emitting items faster than its Observer can consume them to buffer up to a given amount of items until they can be emitted.
BETA Instructs an Observable that is emitting items faster than its Observer can consume them to buffer up to
a given amount of items until they can be emitted. The resulting Observable will emit
BufferOverflowException
as soon as the buffer's capacity is exceeded, drop all undelivered
items, and unsubscribe from the source.
This method does not operate by default on a particular Scheduler.
capacity of the internal buffer.
an Observable that will buffer items up to the given capacity
(if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
Instructs an Observable that is emitting items faster than its observer can consume them to buffer these items indefinitely until they can be emitted.
Instructs an Observable that is emitting items faster than its observer can consume them to buffer these items indefinitely until they can be emitted.
onBackpressureBuffer
does not operate by default on a particular Scheduler
.
the source Observable modified to buffer items to the extent system resources allow
EXPERIMENTAL Instructs an Observable that is emitting items faster than its observer can consume them to discard, rather than emit, those items that its observer is not prepared to observe.
EXPERIMENTAL Instructs an Observable that is emitting items faster than its observer can consume them to discard, rather than emit, those items that its observer is not prepared to observe.
If the downstream request count hits 0
then the Observable will refrain from calling onNext
until
the observer invokes request(n)
again to increase the request count.
This method does not operate by default on a particular Scheduler.
the action to invoke for each item dropped. onDrop
action should be fast and should never block.
an new Observable that will drop onNext
notifications on overflow
(if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
Use this operator when the upstream does not natively support backpressure and you wish to drop
onNext
when unable to handle further events.
Use this operator when the upstream does not natively support backpressure and you wish to drop
onNext
when unable to handle further events.
If the downstream request count hits 0 then onNext
will be dropped until request(long n)
is invoked again to increase the request count.
onBackpressureDrop does not operate by default on a particular
Scheduler.
the source Observable modified to drop onNext
notifications on overflow
EXPERIMENTAL Instructs an Observable that is emitting items faster than its observer can consume them to hold onto the latest value and emit that on request.
EXPERIMENTAL Instructs an Observable that is emitting items faster than its observer can consume them to hold onto the latest value and emit that on request.
Its behavior is logically equivalent to toBlocking().latest()
with the exception that
the downstream is not blocking while requesting more values.
Note that if the upstream Observable does support backpressure, this operator ignores that capability and doesn't propagate any backpressure requests from downstream.
Note that due to the nature of how backpressure requests are propagated through subscribeOn/observeOn, requesting more than 1 from downstream doesn't guarantee a continuous delivery of onNext events.
the source Observable modified so that it emits the most recently-received item upon request
(if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
Instruct an Observable to pass control to another Observable rather than invoking onError if it encounters an error.
Instruct an Observable to pass control to another Observable rather than invoking onError if it encounters an error.
By default, when an Observable encounters an error that prevents it from emitting the
expected item to its rx.lang.scala.Observer, the Observable invokes its Observer's
onError
method, and then quits without invoking any more of its Observer's
methods. The onErrorResumeNext
method changes this behavior. If you pass a
function that returns an Observable (resumeFunction
) to
onErrorResumeNext
, if the original Observable encounters an error, instead of
invoking its Observer's onError
method, it will instead relinquish control to
the Observable returned from resumeFunction
, which will invoke the Observer's
onNext method if it is able to do so. In such a case, because no
Observable necessarily invokes onError
, the Observer may never know that an
error happened.
You can use this to prevent errors from propagating or to supply fallback data should errors be encountered.
a function that returns an Observable that will take over if the source Observable encounters an error
the original Observable, with appropriately modified behavior
Instruct an Observable to emit an item (returned by a specified function) rather than invoking onError if it encounters an error.
Instruct an Observable to emit an item (returned by a specified function) rather than invoking onError if it encounters an error.
By default, when an Observable encounters an error that prevents it from emitting the
expected item to its rx.lang.scala.Observer, the Observable invokes its Observer's
onError
method, and then quits without invoking any more of its Observer's
methods. The onErrorReturn
method changes this behavior. If you pass a function
(resumeFunction
) to an Observable's onErrorReturn
method, if the
original Observable encounters an error, instead of invoking its Observer's
onError
method, it will instead pass the return value of
resumeFunction
to the Observer's onNext method.
You can use this to prevent errors from propagating or to supply fallback data should errors be encountered.
a function that returns an item that the new Observable will emit if the source Observable encounters an error
the original Observable with appropriately modified behavior
Instruct an Observable to pass control to another Observable rather than invoking onError if it encounters an error of type java.lang.Exception
.
Instruct an Observable to pass control to another Observable rather than invoking onError if it encounters an error of type java.lang.Exception
.
This differs from Observable.onErrorResumeNext
in that this one does not handle java.lang.Throwable
or java.lang.Error
but lets those continue through.
By default, when an Observable encounters an error that prevents it from emitting the
expected item to its rx.lang.scala.Observer, the Observable invokes its Observer's
onError
method, and then quits without invoking any more of its Observer's
methods. The onErrorResumeNext
method changes this behavior. If you pass
another Observable (resumeSequence
) to an Observable's
onErrorResumeNext
method, if the original Observable encounters an error,
instead of invoking its Observer's onError
method, it will instead relinquish
control to resumeSequence
which will invoke the Observer's onNext
method if it is able to do so. In such a case, because no
Observable necessarily invokes onError
, the Observer may never know that an
error happened.
You can use this to prevent errors from propagating or to supply fallback data should errors be encountered.
a function that returns an Observable that will take over if the source Observable encounters an error
the original Observable, with appropriately modified behavior
EXPERIMENTAL Return a new Observable that will null out references to the upstream Producer and downstream Subscriber if the sequence is terminated or downstream unsubscribes.
EXPERIMENTAL Return a new Observable that will null out references to the upstream Producer and downstream Subscriber if the sequence is terminated or downstream unsubscribes.
Fully supports backpressure.
This method does not operate by default on a particular Scheduler.
an Observable which out references to the upstream Producer and downstream Subscriber if the sequence is terminated or downstream unsubscribes
Returns an Observable that emits the items emitted by the source Observable or a specified default item if the source Observable is empty.
Returns an Observable that emits the items emitted by the source Observable or a specified default item if the source Observable is empty.
the item to emit if the source Observable emits no items. This is a by-name parameter, so it is only evaluated if the source Observable doesn't emit anything.
an Observable that emits either the specified default item if the source Observable emits no items, or the items emitted by the source Observable
[use case] Returns an Observable that multiplies up the elements of this Observable.
Returns an Observable that multiplies up the elements of this Observable.
This operation is only available if the elements of this Observable are numbers, otherwise you will get a compilation error.
an Observable emitting the product of all the elements of the source Observable as its single item.
Returns an Observable that emits the results of invoking a specified selector on items emitted by a ConnectableObservable
that shares a single subscription to the underlying sequence.
Returns an Observable that emits the results of invoking a specified selector on items emitted by a ConnectableObservable
that shares a single subscription to the underlying sequence.
a function that can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all notifications of the source from the time of the subscription forward.
an Observable that emits the results of invoking the selector on the items emitted by a ConnectableObservable
that shares a single subscription to the underlying sequence
Returns a rx.lang.scala.observables.ConnectableObservable, which waits until the connect
function is called
before it begins emitting items from this
rx.lang.scala.Observable to those rx.lang.scala.Observers that
have subscribed to it.
Returns a rx.lang.scala.observables.ConnectableObservable, which waits until the connect
function is called
before it begins emitting items from this
rx.lang.scala.Observable to those rx.lang.scala.Observers that
have subscribed to it.
EXPERIMENTAL
Returns an Observable that requests n
initially from the upstream and then 75% of n
subsequently after 75% of n
values have
been emitted to the downstream.
EXPERIMENTAL
Returns an Observable that requests n
initially from the upstream and then 75% of n
subsequently after 75% of n
values have
been emitted to the downstream.
This operator allows preventing the downstream to trigger unbounded mode via request(Long.MaxValue)
or compensate for the per-item
overhead of small and frequent requests.
The operator expects backpressure from upstream and honors backpressure from downstream. ===Scheduler:=== This method does not operate by default on a particular [[Scheduler]].
the initial request amount, further request will happen after 75% of this value
the Observable that rebatches request amounts from downstream
Returns an Observable that applies a function of your choosing to the first item emitted by a source Observable, then feeds the result of that function along with the second item emitted by the source Observable into the same function, and so on until all items have been emitted by the source Observable, and emits the final result from the final call to your function as its sole item.
Returns an Observable that applies a function of your choosing to the first item emitted by a source Observable, then feeds the result of that function along with the second item emitted by the source Observable into the same function, and so on until all items have been emitted by the source Observable, and emits the final result from the final call to your function as its sole item.
This technique, which is called "reduce" or "aggregate" here, is sometimes called "fold,"
"accumulate," "compress," or "inject" in other programming contexts. Groovy, for instance,
has an inject
method that does a similar operation on lists.
An accumulator function to be invoked on each item emitted by the source Observable, whose result will be used in the next accumulator call
an Observable that emits a single item that is the result of accumulating the output from the source Observable
Returns an Observable that repeats the sequence of items emitted by the source Observable
at most count
times, on a particular Scheduler.
Returns an Observable that repeats the sequence of items emitted by the source Observable
at most count
times, on a particular Scheduler.
the number of times the source Observable items are repeated, a count of 0 will yield an empty sequence
the Scheduler
to emit the items on
an Observable that repeats the sequence of items emitted by the source Observable at most count
times
on a particular Scheduler
Returns an Observable that repeats the sequence of items emitted by the source Observable at most count
times.
Returns an Observable that repeats the sequence of items emitted by the source Observable at most count
times.
the number of times the source Observable items are repeated, a count of 0 will yield an empty sequence
an Observable that repeats the sequence of items emitted by the source Observable at most count
times
java.lang.IllegalArgumentException
if count
is less than zero
Returns an Observable that repeats the sequence of items emitted by the source Observable indefinitely, on a particular Scheduler.
Returns an Observable that repeats the sequence of items emitted by the source Observable indefinitely, on a particular Scheduler.
the Scheduler to emit the items on
an Observable that emits the items emitted by the source Observable repeatedly and in sequence
Returns an Observable that repeats the sequence of items emitted by the source Observable indefinitely.
Returns an Observable that repeats the sequence of items emitted by the source Observable indefinitely.
an Observable that emits the items emitted by the source Observable repeatedly and in sequence
Returns an Observable that emits the same values as the source Observable with the exception of an
onCompleted
.
Returns an Observable that emits the same values as the source Observable with the exception of an
onCompleted
. An onCompleted
notification from the source will result in the emission of
a scala.Unit
to the Observable provided as an argument to the notificationHandler
function. If the Observable returned onCompletes
or onErrors
then repeatWhen
will
call onCompleted
or onError
on the child subscription. Otherwise, this Observable will
resubscribe to the source observable.
receives an Observable of a Unit with which a user can complete or error, aborting the repeat.
the source Observable modified with repeat logic
This repeats 3 times, each time incrementing the number of seconds it waits.
Observable[String]({ subscriber => println("subscribing") subscriber.onCompleted() }).repeatWhen({ unitObservable => unitObservable.zipWith(Observable.from(1 to 3))((u, i) => i).flatMap(i => { println("delay repeat by " + i + " second(s)") Observable.timer(Duration(i, TimeUnit.SECONDS)) }) }).toBlocking.foreach(s => println(s))
Output is:
subscribing delay repeat by 1 second(s) subscribing delay repeat by 2 second(s) subscribing delay repeat by 3 second(s) subscribing
<dl> <dt>Scheduler:</dt>
0.20
Returns an Observable that emits the same values as the source Observable with the exception of an
onCompleted
.
Returns an Observable that emits the same values as the source Observable with the exception of an
onCompleted
. An onCompleted
notification from the source will result in the emission of
a scala.Unit
to the Observable provided as an argument to the notificationHandler
function. If the Observable returned onCompletes
or onErrors
then repeatWhen
will
call onCompleted
or onError
on the child subscription. Otherwise, this Observable will
resubscribe to the source Observable, on a particular Scheduler.
<dl> <dt>Scheduler:</dt>
receives an Observable of a Unit with which a user can complete or error, aborting the repeat.
the Scheduler to emit the items on
the source Observable modified with repeat logic
0.20
Returns a ConnectableObservable
that shares a single subscription to the source Observable that
will replay all of its items and notifications to any future Observer
on the given Scheduler
.
Returns a ConnectableObservable
that shares a single subscription to the source Observable that
will replay all of its items and notifications to any future Observer
on the given Scheduler
.
the Scheduler on which the Observers will observe the emitted items
a ConnectableObservable
that shares a single subscription to the source Observable that
will replay all of its items and notifications to any future bserver
on the given Scheduler
Returns a ConnectableObservable
that shares a single subscription to the source Observable and
replays all items emitted by that Observable within a specified time window.
Returns a ConnectableObservable
that shares a single subscription to the source Observable and
replays all items emitted by that Observable within a specified time window.
the duration of the window in which the replayed items must have been emitted
the Scheduler that is the time source for the window
a ConnectableObservable
that shares a single subscription to the source Observable and
replays the items that were emitted during the window defined by time
Returns a ConnectableObservable
that shares a single subscription to the source Observable and
replays all items emitted by that Observable within a specified time window.
Returns a ConnectableObservable
that shares a single subscription to the source Observable and
replays all items emitted by that Observable within a specified time window.
the duration of the window in which the replayed items must have been emitted
a ConnectableObservable
that shares a single subscription to the source Observable and
replays the items that were emitted during the window defined by time
Returns a ConnectableObservable
that shares a single subscription to the source Observable and
replays at most bufferSize
items emitted by that Observable.
Returns a ConnectableObservable
that shares a single subscription to the source Observable and
replays at most bufferSize
items emitted by that Observable.
the buffer size that limits the number of items that can be replayed
the scheduler on which the Observers will observe the emitted items
a ConnectableObservable
that shares a single subscription to the source Observable and
replays at most bufferSize
items that were emitted by the Observable
Returns a ConnectableObservable
that shares a single subscription to the source Observable that
replays at most bufferSize
items emitted by that Observable.
Returns a ConnectableObservable
that shares a single subscription to the source Observable that
replays at most bufferSize
items emitted by that Observable.
the buffer size that limits the number of items that can be replayed
a ConnectableObservable
that shares a single subscription to the source Observable and
replays at most bufferSize
items emitted by that Observable
Returns an Observable that emits items that are the results of invoking a specified selector on items
emitted by a ConnectableObservable
that shares a single subscription to the source Observable,
replaying all items that were emitted within a specified time window.
Returns an Observable that emits items that are the results of invoking a specified selector on items
emitted by a ConnectableObservable
that shares a single subscription to the source Observable,
replaying all items that were emitted within a specified time window.
a selector function, which can use the multicasted sequence as many times as needed, without causing multiple subscriptions to the Observable
the duration of the window in which the replayed items must have been emitted
an Observable that emits items that are the results of invoking the selector on items emitted by
a ConnectableObservable
that shares a single subscription to the source Observable,
replaying all items that were emitted within the window defined by time
Returns a ConnectableObservable
that shares a single subscription to the source Observable and
that replays a maximum of bufferSize
items that are emitted within a specified time window.
Returns a ConnectableObservable
that shares a single subscription to the source Observable and
that replays a maximum of bufferSize
items that are emitted within a specified time window.
the buffer size that limits the number of items that can be replayed
the duration of the window in which the replayed items must have been emitted
the scheduler that is used as a time source for the window
a ConnectableObservable
that shares a single subscription to the source Observable and
replays at most bufferSize
items that were emitted during the window defined by time
java.lang.IllegalArgumentException
if bufferSize
is less than zero
Returns a ConnectableObservable
that shares a single subscription to the source Observable and
replays at most bufferSize
items that were emitted during a specified time window.
Returns a ConnectableObservable
that shares a single subscription to the source Observable and
replays at most bufferSize
items that were emitted during a specified time window.
the buffer size that limits the number of items that can be replayed
the duration of the window in which the replayed items must have been emitted
a ConnectableObservable
that shares a single subscription to the source Observable and
replays at most bufferSize
items that were emitted during the window defined by time
Returns an Observable that emits items that are the results of invoking a specified selector on items
emitted by a ConnectableObservable
that shares a single subscription to the source Observable.
Returns an Observable that emits items that are the results of invoking a specified selector on items
emitted by a ConnectableObservable
that shares a single subscription to the source Observable.
a selector function, which can use the multicasted sequence as many times as needed, without causing multiple subscriptions to the Observable
the Scheduler where the replay is observed
an Observable that emits items that are the results of invoking the selector on items emitted by
a ConnectableObservable
that shares a single subscription to the source Observable,
replaying all items
Returns an Observable that emits items that are the results of invoking a specified selector on items
emitted by a ConnectableObservable
that shares a single subscription to the source Observable,
replaying all items that were emitted within a specified time window.
Returns an Observable that emits items that are the results of invoking a specified selector on items
emitted by a ConnectableObservable
that shares a single subscription to the source Observable,
replaying all items that were emitted within a specified time window.
a selector function, which can use the multicasted sequence as many times as needed, without causing multiple subscriptions to the Observable
the duration of the window in which the replayed items must have been emitted
an Observable that emits items that are the results of invoking the selector on items emitted by
a ConnectableObservable
that shares a single subscription to the source Observable,
replaying all items that were emitted within the window defined by time
Returns an Observable that emits items that are the results of invoking a specified selector on items
emitted by a ConnectableObservable
that shares a single subscription to the source Observable,
replaying a maximum of bufferSize
items.
Returns an Observable that emits items that are the results of invoking a specified selector on items
emitted by a ConnectableObservable
that shares a single subscription to the source Observable,
replaying a maximum of bufferSize
items.
a selector function, which can use the multicasted sequence as many times as needed, without causing multiple subscriptions to the Observable
the buffer size that limits the number of items the connectable observable can replay
the Scheduler on which the replay is observed
an Observable that emits items that are the results of invoking the selector on items emitted by
a ConnectableObservable
that shares a single subscription to the source Observable,
replaying no more than bufferSize
notifications
Returns an Observable that emits items that are the results of invoking a specified selector on items
emitted by a ConnectableObservable
that shares a single subscription to the source Observable,
replaying no more than bufferSize
items that were emitted within a specified time window.
Returns an Observable that emits items that are the results of invoking a specified selector on items
emitted by a ConnectableObservable
that shares a single subscription to the source Observable,
replaying no more than bufferSize
items that were emitted within a specified time window.
a selector function, which can use the multicasted sequence as many times as needed, without causing multiple subscriptions to the Observable
the buffer size that limits the number of items the connectable observable can replay
the duration of the window in which the replayed items must have been emitted
the Scheduler that is the time source for the window
an Observable that emits items that are the results of invoking the selector on items emitted by
a ConnectableObservable
that shares a single subscription to the source Observable, and
replays no more than bufferSize
items that were emitted within the window defined by time
java.lang.IllegalArgumentException
if bufferSize
is less than zero
Returns an Observable that emits items that are the results of invoking a specified selector on items
emitted by a ConnectableObservable
that shares a single subscription to the source Observable,
replaying no more than bufferSize
items that were emitted within a specified time window.
Returns an Observable that emits items that are the results of invoking a specified selector on items
emitted by a ConnectableObservable
that shares a single subscription to the source Observable,
replaying no more than bufferSize
items that were emitted within a specified time window.
a selector function, which can use the multicasted sequence as many times as needed, without causing multiple subscriptions to the Observable
the buffer size that limits the number of items the connectable observable can replay
the duration of the window in which the replayed items must have been emitted
an Observable that emits items that are the results of invoking the selector on items emitted by
a ConnectableObservable
that shares a single subscription to the source Observable, and
replays no more than bufferSize
items that were emitted within the window defined by time
Returns an Observable that emits items that are the results of invoking a specified selector on items
emitted by a ConnectableObservable
that shares a single subscription to the source Observable,
replaying bufferSize
notifications.
Returns an Observable that emits items that are the results of invoking a specified selector on items
emitted by a ConnectableObservable
that shares a single subscription to the source Observable,
replaying bufferSize
notifications.
the selector function, which can use the multicasted sequence as many times as needed, without causing multiple subscriptions to the Observable
the buffer size that limits the number of items the connectable observable can replay
an Observable that emits items that are the results of invoking the selector on items emitted by
a ConnectableObservable
that shares a single subscription to the source Observable replaying
no more than bufferSize
items
Returns an Observable that emits items that are the results of invoking a specified selector on the items
emitted by a ConnectableObservable
that shares a single subscription to the source Observable.
Returns an Observable that emits items that are the results of invoking a specified selector on the items
emitted by a ConnectableObservable
that shares a single subscription to the source Observable.
the selector function, which can use the multicasted sequence as many times as needed, without causing multiple subscriptions to the Observable
an Observable that emits items that are the results of invoking the selector on a ConnectableObservable
that shares a single subscription to the source Observable
Returns a rx.lang.scala.observables.ConnectableObservable that shares a single subscription to the underlying Observable that will replay all of its items and notifications to any future rx.lang.scala.Observer.
Returns a rx.lang.scala.observables.ConnectableObservable that shares a single subscription to the underlying Observable that will replay all of its items and notifications to any future rx.lang.scala.Observer.
a rx.lang.scala.observables.ConnectableObservable such that when the connect
function
is called, the rx.lang.scala.observables.ConnectableObservable starts to emit items to its rx.lang.scala.Observers
Returns an Observable that mirrors the source Observable, resubscribing to it if it calls onError
and the predicate returns true for that specific exception and retry count.
Returns an Observable that mirrors the source Observable, resubscribing to it if it calls onError
and the predicate returns true for that specific exception and retry count.
the predicate that determines if a resubscription may happen in case of a specific exception and retry count
the source Observable modified with retry logic
Retry subscription to origin Observable whenever onError is called (infinite retry count).
Retry subscription to origin Observable whenever onError is called (infinite retry count).
If rx.lang.scala.Observer.onError is invoked the source Observable will be re-subscribed to.
Any rx.lang.scala.Observer.onNext calls received on each attempt will be emitted and concatenated together.
For example, if an Observable fails on first time but emits [1, 2] then succeeds the second time and emits [1, 2, 3, 4, 5] then the complete output would be [1, 2, 1, 2, 3, 4, 5, onCompleted].
Observable with retry logic.
Retry subscription to origin Observable upto given retry count.
Retry subscription to origin Observable upto given retry count.
If rx.lang.scala.Observer.onError is invoked the source Observable will be re-subscribed to as many times as defined by retryCount.
Any rx.lang.scala.Observer.onNext calls received on each attempt will be emitted and concatenated together.
For example, if an Observable fails on first time but emits [1, 2] then succeeds the second time and emits [1, 2, 3, 4, 5] then the complete output would be [1, 2, 1, 2, 3, 4, 5, onCompleted].
Number of retry attempts before failing.
Observable with retry logic.
Returns an Observable that emits the same values as the source observable with the exception of an onError
.
Returns an Observable that emits the same values as the source observable with the exception of an onError
.
An onError will emit a Throwable
to the Observable provided as an argument to the notificationHandler
function. If the Observable returned onCompletes
or onErrors
then retry will call onCompleted
or onError
on the child subscription. Otherwise, this observable will resubscribe to the source observable, on a particular Scheduler.
<dl> <dt>Scheduler:</dt>
receives an Observable of a Throwable with which a user can complete or error, aborting the retry
the Scheduler on which to subscribe to the source Observable
the source Observable modified with retry logic
0.20
RxScalaDemo.retryWhenDifferentExceptionsExample for a more intricate example
Returns an Observable that emits the same values as the source observable with the exception of an
onError
.
Returns an Observable that emits the same values as the source observable with the exception of an
onError
. An onError
notification from the source will result in the emission of a
Throwable
to the Observable provided as an argument to the notificationHandler
function. If the Observable returned onCompletes
or onErrors
then retry
will call
onCompleted
or onError
on the child subscription. Otherwise, this Observable will
resubscribe to the source Observable.
Example:
This retries 3 times, each time incrementing the number of seconds it waits.
receives an Observable of a Throwable with which a user can complete or error, aborting the retry
the source Observable modified with retry logic
This retries 3 times, each time incrementing the number of seconds it waits.
Observable[String]({ subscriber => println("subscribing") subscriber.onError(new RuntimeException("always fails")) }).retryWhen({ throwableObservable => throwableObservable.zipWith(Observable.from(1 to 3))((t, i) => i).flatMap(i => { println("delay retry by " + i + " second(s)") Observable.timer(Duration(i, TimeUnit.SECONDS)) }) }).toBlocking.foreach(s => println(s))
Output is:
subscribing delay retry by 1 second(s) subscribing delay retry by 2 second(s) subscribing delay retry by 3 second(s) subscribing
<dl> <dt>Scheduler:</dt>
0.20
RxScalaDemo.retryWhenDifferentExceptionsExample for a more intricate example
Return an Observable that emits the results of sampling the items emitted by the source Observable whenever the specified sampler Observable emits an item or completes.
Return an Observable that emits the results of sampling the items emitted by the source Observable whenever the specified sampler Observable emits an item or completes.
the Observable to use for sampling the source Observable
an Observable that emits the results of sampling the items emitted by this Observable whenever the sampler Observable emits an item or completes
Returns an Observable that emits the results of sampling the items emitted by the source Observable at a specified time interval.
Returns an Observable that emits the results of sampling the items emitted by the source Observable at a specified time interval.
the sampling rate
the rx.lang.scala.Scheduler to use when sampling
an Observable that emits the results of sampling the items emitted by the source Observable at the specified time interval
Returns an Observable that emits the results of sampling the items emitted by the source Observable at a specified time interval.
Returns an Observable that emits the results of sampling the items emitted by the source Observable at a specified time interval.
the sampling rate
an Observable that emits the results of sampling the items emitted by the source Observable at the specified time interval
Returns an Observable that applies a function of your choosing to the first item emitted by a source Observable, then feeds the result of that function along with the second item emitted by an Observable into the same function, and so on until all items have been emitted by the source Observable, emitting the result of each of these iterations.
Returns an Observable that applies a function of your choosing to the first item emitted by a source Observable, then feeds the result of that function along with the second item emitted by an Observable into the same function, and so on until all items have been emitted by the source Observable, emitting the result of each of these iterations.
an accumulator function to be invoked on each item emitted by the source Observable, whose result will be emitted to rx.lang.scala.Observers via onNext and used in the next accumulator call.
an Observable that emits the results of each call to the accumulator function
Returns an Observable that applies a function of your choosing to the first item emitted by a source Observable, then feeds the result of that function along with the second item emitted by an Observable into the same function, and so on until all items have been emitted by the source Observable, emitting the result of each of these iterations.
Returns an Observable that applies a function of your choosing to the first item emitted by a source Observable, then feeds the result of that function along with the second item emitted by an Observable into the same function, and so on until all items have been emitted by the source Observable, emitting the result of each of these iterations.
This sort of function is sometimes called an accumulator.
Note that when you pass a seed to scan()
the resulting Observable will emit
that seed as its first emitted item.
the initial (seed) accumulator value
an accumulator function to be invoked on each item emitted by the source Observable, whose result will be emitted to rx.lang.scala.Observers via onNext and used in the next accumulator call.
an Observable that emits the results of each call to the accumulator function
Returns an Observable that emits a Boolean value that indicates whether this
and that
Observable sequences are the
same by comparing the items emitted by each Observable pairwise.
Returns an Observable that emits a Boolean value that indicates whether this
and that
Observable sequences are the
same by comparing the items emitted by each Observable pairwise.
Note: this method uses ==
to compare elements. It's a bit different from RxJava which uses Object.equals
.
the Observable to compare
an Observable that emits a Boolean
value that indicates whether the two sequences are the same
Returns an Observable that emits a Boolean value that indicates whether this
and that
Observable sequences are the
same by comparing the items emitted by each Observable pairwise based on the results of a specified equality
function.
Returns an Observable that emits a Boolean value that indicates whether this
and that
Observable sequences are the
same by comparing the items emitted by each Observable pairwise based on the results of a specified equality
function.
the Observable to compare
a function used to compare items emitted by each Observable
an Observable that emits a Boolean
value that indicates whether the two sequences are the same based on the equality
function.
Wraps this Observable in another Observable that ensures that the resulting Observable is chronologically well-behaved.
Wraps this Observable in another Observable that ensures that the resulting Observable is chronologically well-behaved.
A well-behaved Observable does not interleave its invocations of the onNext, onCompleted, and onError methods of
its rx.lang.scala.Observers; it invokes onCompleted
or onError
only once; and it never invokes onNext
after invoking either onCompleted
or onError
.
serialize enforces this, and the Observable it returns invokes onNext
and onCompleted
or onError
synchronously.
an Observable that is a chronologically well-behaved version of the source Observable, and that synchronously notifies its rx.lang.scala.Observers
Returns a new Observable that multicasts (shares) the original Observable.
Returns a new Observable that multicasts (shares) the original Observable. As long a there is more than 1 Subscriber, this Observable will be subscribed and emitting data. When all subscribers have unsubscribed it will unsubscribe from the source Observable.
This is an alias for publish().refCount()
a Observable that upon connection causes the source Observable to emit items to its Subscribers
0.19
If the source Observable completes after emitting a single item, return an Observable that emits that item.
If the source Observable completes after emitting a single item, return an Observable that emits 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
"MSDN: Observable.singleAsync()"
If the source Observable completes after emitting a single item, return an Observable that emits an Option
with that item; if the source Observable is empty, return an Observable that emits None
.
If the source Observable completes after emitting a single item, return an Observable that emits an Option
with that item; if the source Observable is empty, return an Observable that emits None
.
If the source Observable emits more than one item, throw an IllegalArgumentException
.
an Observable that emits 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 an Observable that emits that item; if the source Observable is empty, return an Observable that emits a default item.
If the source Observable completes after emitting a single item, return an Observable that emits that
item; if the source Observable is empty, return an Observable that emits 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.
an Observable that emits 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
Returns an Observable that counts the total number of elements in the source Observable.
Returns an Observable that counts the total number of elements in the source Observable.
an Observable emitting the number of counted elements of the source Observable as its single item.
Returns an Observable that emits windows of items it collects from the source Observable.
Returns an Observable that emits windows of items it collects from the source Observable. The resulting
Observable starts a new window periodically, as determined by the timeshift
argument or a maximum
size as specified by the count
argument (whichever is reached first). It emits
each window after a fixed timespan, specified by the timespan
argument. When the source
Observable completes or Observable completes or encounters an error, the resulting Observable emits the
current window and propagates the notification from the source Observable.
This operator does not support backpressure as it uses time to control data flow.
you specify which Scheduler
this operator will use
the period of time each window collects items before it should be emitted
the period of time after which a new window will be created
the maximum size of each window before it should be emitted
the Scheduler
to use when determining the end and start of a window
an Observable that emits new windows periodically as a fixed timespan elapses
Creates an Observable which produces windows of collected values.
Creates an Observable which produces windows of collected values. This Observable starts a new window
periodically, which is determined by the timeshift
argument. Each window is emitted after a fixed timespan
specified by the timespan
argument. When the source Observable completes or encounters an error, the
current window is emitted and the event is propagated.
The period of time each window is collecting values before it should be emitted.
The period of time after which a new window will be created.
The rx.lang.scala.Scheduler to use when determining the end and start of a window.
An rx.lang.scala.Observable which produces new windows periodically, and these are emitted after a fixed timespan has elapsed.
Creates an Observable which produces windows of collected values.
Creates an Observable which produces windows of collected values. This Observable starts a new window
periodically, which is determined by the timeshift
argument. Each window is emitted after a fixed timespan
specified by the timespan
argument. When the source Observable completes or encounters an error, the
current window is emitted and the event is propagated.
The period of time each window is collecting values before it should be emitted.
The period of time after which a new window will be created.
An rx.lang.scala.Observable which produces new windows periodically, and these are emitted after a fixed timespan has elapsed.
Creates an Observable which produces windows of collected values.
Creates an Observable which produces windows of collected values. This Observable produces windows every
skip
values, each containing count
elements. When the source Observable completes or encounters an error,
the current window is emitted and the event is propagated.
The maximum size of each window before it should be emitted.
How many produced values need to be skipped before starting a new window. Note that when skip
and
count
are equal that this is the same operation as window(int)
.
An rx.lang.scala.Observable which produces windows every skip
values containing at most
count
produced values.
Creates an Observable which produces windows of collected values.
Creates an Observable which produces windows of collected values. Chunks are created when the specified openings
Observable produces an object. That object is used to construct an Observable to emit windows, feeding it into closings
function.
Windows are emitted when the created Observable produces an object.
The rx.lang.scala.Observable which when it produces an object, will cause another window to be created.
The function which is used to produce an rx.lang.scala.Observable for every window created. When this rx.lang.scala.Observable produces an object, the associated window is emitted.
An rx.lang.scala.Observable which produces windows which are created and emitted when the specified rx.lang.scala.Observables publish certain objects.
Creates an Observable which produces buffers of collected values.
Creates an Observable which produces buffers of collected values. This Observable starts a new buffer
periodically, which is determined by the timeshift
argument. Each buffer is emitted after a fixed timespan
specified by the timespan
argument. When the source Observable completes or encounters an error, the
current buffer is emitted and the event is propagated.
The period of time each buffer is collecting values before it should be emitted.
The period of time after which a new buffer will be created.
The rx.lang.scala.Scheduler to use when determining the end and start of a buffer.
An rx.lang.scala.Observable which produces new buffers periodically, and these are emitted after a fixed timespan has elapsed.
Creates an Observable which produces buffers of collected values.
Creates an Observable which produces buffers of collected values. This Observable starts a new buffer
periodically, which is determined by the timeshift
argument. Each buffer is emitted after a fixed timespan
specified by the timespan
argument. When the source Observable completes or encounters an error, the
current buffer is emitted and the event is propagated.
The period of time each buffer is collecting values before it should be emitted.
The period of time after which a new buffer will be created.
An rx.lang.scala.Observable which produces new buffers periodically, and these are emitted after a fixed timespan has elapsed.
Creates an Observable which produces buffers of collected values.
Creates an Observable which produces buffers of collected values.
This Observable produces buffers every skip
values, each containing count
elements. When the source Observable completes or encounters an error, the current
buffer is emitted, and the event is propagated.
The maximum size of each buffer before it should be emitted.
How many produced values need to be skipped before starting a new buffer. Note that when skip
and
count
are equals that this is the same operation as buffer(int)
.
An rx.lang.scala.Observable which produces buffers every skip
values containing at most
count
produced values.
Creates an Observable which produces buffers of collected values.
Creates an Observable which produces buffers of collected values.
This Observable produces buffers. Buffers are created when the specified openings
Observable produces an object. That object is used to construct an Observable to emit buffers, feeding it into closings
function.
Buffers are emitted when the created Observable produces an object.
The rx.lang.scala.Observable which, when it produces an object, will cause another buffer to be created.
The function which is used to produce an rx.lang.scala.Observable for every buffer created. When this rx.lang.scala.Observable produces an object, the associated buffer is emitted.
An rx.lang.scala.Observable which produces buffers which are created and emitted when the specified rx.lang.scala.Observables publish certain objects.
Call this method to receive items and notifications from this observable.
Call this method to receive items and notifications from this observable.
This method does not operate by default on a particular Scheduler.
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
a rx.lang.scala.Subscription reference whose unsubscribe
method can be called to stop receiving items
before the Observable has finished sending them
Call this method to receive items and notifications from this observable.
Call this method to receive items and notifications from this observable.
This method does not operate by default on a particular Scheduler.
this function will be called whenever the Observable emits an item
this function will be called if an error occurs
a rx.lang.scala.Subscription reference whose unsubscribe
method can be called to stop receiving items
before the Observable has finished sending them
Call this method to receive items from this observable.
Call this method to receive items from this observable.
This method does not operate by default on a particular Scheduler.
this function will be called whenever the Observable emits an item
a rx.lang.scala.Subscription reference whose unsubscribe
method can be called to stop receiving items
before the Observable has finished sending them
rx.exceptions.OnErrorNotImplementedException
if the Observable tries to call onError
Call this method to subscribe an Subscriber for receiving items and notifications from the Observable.
Call this method to subscribe an Subscriber for receiving items and notifications from the Observable.
A typical implementation of subscribe
does the following:
It stores a reference to the Observer in a collection object, such as a List[T]
object.
It returns a reference to the rx.lang.scala.Subscription interface. This enables Subscribers to unsubscribe, that is, to stop receiving items and notifications before the Observable stops sending them, which also invokes the Subscriber's onCompleted method.
An Observable instance is responsible for accepting all subscriptions and notifying all Subscribers. Unless the documentation for a particular Observable implementation indicates otherwise, Subscribers should make no assumptions about the order in which multiple Subscribers will receive their notifications.
This method does not operate by default on a particular Scheduler.
the Subscriber
a rx.lang.scala.Subscription reference whose unsubscribe
method can be called to stop receiving items
before the Observable has finished sending them
Call this method to subscribe an rx.lang.scala.Observer for receiving items and notifications from the Observable.
Call this method to subscribe an rx.lang.scala.Observer for receiving items and notifications from the Observable.
A typical implementation of subscribe
does the following:
It stores a reference to the Observer in a collection object, such as a List[T]
object.
It returns a reference to the rx.lang.scala.Subscription interface. This enables Observers to unsubscribe, that is, to stop receiving items and notifications before the Observable stops sending them, which also invokes the Observer's onCompleted method.
An Observable[T]
instance is responsible for accepting all subscriptions
and notifying all Observers. Unless the documentation for a particular
Observable[T]
implementation indicates otherwise, Observers should make no
assumptions about the order in which multiple Observers will receive their notifications.
This method does not operate by default on a particular Scheduler.
the observer
a rx.lang.scala.Subscription reference whose unsubscribe
method can be called to stop receiving items
before the Observable has finished sending them
Subscribes to an Observable but ignore its emissions and notifications.
Subscribes to an Observable but ignore its emissions and notifications.
This method does not operate by default on a particular Scheduler.
a rx.lang.scala.Subscription reference whose unsubscribe
method can be called to stop receiving items
before the Observable has finished sending them
rx.exceptions.OnErrorNotImplementedException
if the Observable tries to call onError
Asynchronously subscribes and unsubscribes Observers on the specified rx.lang.scala.Scheduler.
Asynchronously subscribes and unsubscribes Observers on the specified rx.lang.scala.Scheduler.
the rx.lang.scala.Scheduler to perform subscription and unsubscription actions on
the source Observable modified so that its subscriptions and unsubscriptions happen on the specified rx.lang.scala.Scheduler
[use case] Returns an Observable that sums up the elements of this Observable.
Returns an Observable that sums up the elements of this Observable.
This operation is only available if the elements of this Observable are numbers, otherwise you will get a compilation error.
an Observable emitting the sum of all the elements of the source Observable as its single item.
[use case] Given an Observable that emits Observables, creates a single Observable that emits the items emitted by the most recently published of those Observables.
Given an Observable that emits Observables, creates a single Observable that emits the items emitted by the most recently published of those Observables.
This operation is only available if this
is of type Observable[Observable[U]]
for some U
,
otherwise you'll get a compilation error.
an Observable that emits only the items emitted by the most recently published Observable
EXPERIMENTAL Returns an Observable that emits the items emitted by the source Observable or the items of an alternate Observable if the source Observable is empty.
EXPERIMENTAL Returns an Observable that emits the items emitted by the source Observable or the items of an alternate Observable if the source Observable is empty.
This method does not operate by default on a particular Scheduler.
the alternate Observable to subscribe to if the source does not emit any items
an Observable that emits the items emitted by the source Observable or the items of an
(if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number) alternate Observable if the source Observable is empty.
Returns a new Observable by applying a function that you supply to each item emitted by the source Observable that returns an Observable, and then emitting the items emitted by the most recently emitted of these Observables.
Returns a new Observable by applying a function that you supply to each item emitted by the source Observable that returns an Observable, and then emitting the items emitted by the most recently emitted of these Observables.
a function that, when applied to an item emitted by the source Observable, returns an Observable
an Observable that emits the items emitted by the Observable returned from applying a function to the most recently emitted item emitted by the source Observable
Returns an Observable that emits all items except the first one, or raises an UnsupportedOperationException
if the source Observable is empty.
Returns an Observable that emits all items except the first one, or raises an UnsupportedOperationException
if the source Observable is empty.
an Observable that emits all items except the first one, or raises an UnsupportedOperationException
if the source Observable is empty.
Returns an Observable that emits those items emitted by source Observable before a specified time (on specified Scheduler) runs out
Returns an Observable that emits those items emitted by source Observable before a specified time (on specified Scheduler) runs out
the length of the time window
the Scheduler used for time source
an Observable that emits those items emitted by the source Observable before the time runs out, according to the specified Scheduler
Returns an Observable that emits those items emitted by source Observable before a specified time runs out.
Returns an Observable that emits those items emitted by source Observable before a specified time runs out.
the length of the time window
an Observable that emits those items emitted by the source Observable before the time runs out
Returns an Observable that emits only the first num
items emitted by the source
Observable.
Returns an Observable that emits only the first num
items emitted by the source
Observable.
This method returns an Observable that will invoke a subscribing rx.lang.scala.Observer's
onNext function a maximum of num
times before invoking
onCompleted.
the number of items to take
an Observable that emits only the first num
items from the source
Observable, or all of the items from the source Observable if that Observable emits
fewer than num
items
Return an Observable that emits at most a specified number of items from the source Observable that were
emitted in a specified window of time
before the Observable completed, where the timing information is
provided by a given Scheduler.
Return an Observable that emits at most a specified number of items from the source Observable that were
emitted in a specified window of time
before the Observable completed, where the timing information is
provided by a given Scheduler.
the maximum number of items to emit
the length of the time window
the Scheduler that provides the timestamps for the observed items
an Observable that emits at most count
items from the source Observable that were emitted
in a specified window of time before the Observable completed, where the timing information is
provided by the given scheduler
java.lang.IllegalArgumentException
if count
is less than zero
Return an Observable that emits at most a specified number of items from the source Observable that were emitted in a specified window of time before the Observable completed.
Return an Observable that emits at most a specified number of items from the source Observable that were emitted in a specified window of time before the Observable completed.
the maximum number of items to emit
the length of the time window
an Observable that emits at most count
items from the source Observable that were emitted
in a specified window of time before the Observable completed
java.lang.IllegalArgumentException
if count
is less than zero
Return an Observable that emits the items from the source Observable that were emitted in a specified
window of time
before the Observable completed, where the timing information is provided by a specified
Scheduler.
Return an Observable that emits the items from the source Observable that were emitted in a specified
window of time
before the Observable completed, where the timing information is provided by a specified
Scheduler.
the length of the time window
the Scheduler that provides the timestamps for the Observed items
an Observable that emits the items from the source Observable that were emitted in the window of
time before the Observable completed specified by time
, where the timing information is
provided by scheduler
Return an Observable that emits the items from the source Observable that were emitted in a specified
window of time
before the Observable completed.
Return an Observable that emits the items from the source Observable that were emitted in a specified
window of time
before the Observable completed.
the length of the time window
an Observable that emits the items from the source Observable that were emitted in the window of
time before the Observable completed specified by time
Returns an Observable that emits only the last count
items emitted by the source
Observable.
Returns an Observable that emits only the last count
items emitted by the source
Observable.
the number of items to emit from the end of the sequence emitted by the source Observable
an Observable that emits only the last count
items emitted by the source
Observable
Returns an Observable that emits the items from the source Observable only until the
other
Observable emits an item.
Returns an Observable that emits the items from the source Observable only until the
other
Observable emits an item.
the Observable whose first emitted item will cause takeUntil
to stop
emitting items from the source Observable
an Observable that emits the items of the source Observable until such time as
other
emits its first item
EXPERIMENTAL Returns an Observable that emits items emitted by the source Observable, checks the specified predicate for each item, and then completes if the condition is satisfied.
EXPERIMENTAL Returns an Observable that emits items emitted by the source Observable, checks the specified predicate for each item, and then completes if the condition is satisfied.
The difference between this operator and takeWhile(T => Boolean)
is that here, the condition is
evaluated after the item is emitted.
This method does not operate by default on a particular Scheduler.
a function that evaluates an item emitted by the source Observable and returns a Boolean
an Observable that first emits items emitted by the source Observable, checks the specified condition after each item, and then completes if the condition is satisfied.
(if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
Returns an Observable that emits items emitted by the source Observable so long as a specified condition is true.
Returns an Observable that emits items emitted by the source Observable so long as a specified condition is true.
a function that evaluates an item emitted by the source Observable and returns a Boolean
an Observable that emits the items from the source Observable so long as each item
satisfies the condition defined by predicate
Throttles by skipping value until skipDuration
passes and then emits the next received value.
Throttles by skipping value until skipDuration
passes and then emits the next received value.
This differs from Observable.throttleLast
in that this only tracks passage of time whereas Observable.throttleLast
ticks at scheduled intervals.
Time to wait before sending another value after emitting last value.
Observable which performs the throttle operation.
Throttles by skipping value until skipDuration
passes and then emits the next received value.
Throttles by skipping value until skipDuration
passes and then emits the next received value.
This differs from Observable.throttleLast
in that this only tracks passage of time whereas Observable.throttleLast
ticks at scheduled intervals.
Time to wait before sending another value after emitting last value.
The rx.lang.scala.Scheduler to use internally to manage the timers which handle timeout for each event.
Observable which performs the throttle operation.
Throttles by returning the last value of each interval defined by 'intervalDuration'.
Throttles by returning the last value of each interval defined by 'intervalDuration'.
This differs from Observable.throttleFirst
in that this ticks along at a scheduled interval whereas Observable.throttleFirst
does not tick, it just tracks passage of time.
Duration of windows within with the last value will be chosen.
Observable which performs the throttle operation.
Throttles by returning the last value of each interval defined by 'intervalDuration'.
Throttles by returning the last value of each interval defined by 'intervalDuration'.
This differs from Observable.throttleFirst
in that this ticks along at a scheduled interval whereas Observable.throttleFirst
does not tick, it just tracks passage of time.
Duration of windows within with the last value will be chosen.
Observable which performs the throttle operation.
Debounces by dropping all values that are followed by newer values before the timeout value expires.
Debounces by dropping all values that are followed by newer values before the timeout value expires. The timer resets on each onNext
call.
NOTE: If events keep firing faster than the timeout then no data will be emitted.
The time each value has to be 'the most recent' of the rx.lang.scala.Observable to ensure that it's not dropped.
The rx.lang.scala.Scheduler to use internally to manage the timers which handle timeout for each event.
Observable which performs the throttle operation.
Observable.debounce
Debounces by dropping all values that are followed by newer values before the timeout value expires.
Debounces by dropping all values that are followed by newer values before the timeout value expires. The timer resets on each onNext
call.
NOTE: If events keep firing faster than the timeout then no data will be emitted.
Information on debounce vs throttle:
The time each value has to be 'the most recent' of the rx.lang.scala.Observable to ensure that it's not dropped.
An rx.lang.scala.Observable which filters out values which are too quickly followed up with newer values.
Observable.debounce
Returns an Observable that emits records of the time interval between consecutive items emitted by the source Observable, where this interval is computed on a specified Scheduler.
Returns an Observable that emits records of the time interval between consecutive items emitted by the source Observable, where this interval is computed on a specified Scheduler.
the Scheduler used to compute time intervals
an Observable that emits time interval information items
Returns an Observable that emits records of the time interval between consecutive items emitted by the source Observable.
Returns an Observable that emits records of the time interval between consecutive items emitted by the source Observable.
an Observable that emits time interval information items
Returns an Observable that mirrors the source Observable, but switches to a fallback Observable if either the first item emitted by the source Observable or any subsequent item don't arrive within time windows defined by other Observables.
Returns an Observable that mirrors the source Observable, but switches to a fallback Observable if either the first item emitted by the source Observable or any subsequent item don't arrive within time windows defined by other Observables.
a function that returns an Observable which determines the timeout window for the first source item
a function that returns an Observable for each item emitted by the source Observable and that determines the timeout window in which the subsequent source item must arrive in order to continue the sequence
the fallback Observable to switch to if the source Observable times out
an Observable that mirrors the source Observable, but switches to the other
Observable if either the first item emitted by the source Observable or any
subsequent item don't arrive within time windows defined by the timeout selectors
Returns an Observable that mirrors the source Observable, but emits a TimeoutException if either the first item emitted by the source Observable or any subsequent item don't arrive within time windows defined by other Observables.
Returns an Observable that mirrors the source Observable, but emits a TimeoutException if either the first item emitted by the source Observable or any subsequent item don't arrive within time windows defined by other Observables.
a function that returns an Observable that determines the timeout window for the first source item
a function that returns an Observable for each item emitted by the source Observable and that determines the timeout window in which the subsequent source item must arrive in order to continue the sequence
an Observable that mirrors the source Observable, but emits a TimeoutException if either the first item or any subsequent item doesn't arrive within the time windows specified by the timeout selectors
Returns an Observable that mirrors the source Observable, but that switches to a fallback Observable if an item emitted by the source Observable doesn't arrive within a window of time after the emission of the previous item, where that period of time is measured by an Observable that is a function of the previous item.
Returns an Observable that mirrors the source Observable, but that switches to a fallback Observable if an item emitted by the source Observable doesn't arrive within a window of time after the emission of the previous item, where that period of time is measured by an Observable that is a function of the previous item.
Note: The arrival of the first source item is never timed out.
a function that returns an observable for each item emitted by the source Observable and that determines the timeout window for the subsequent item
the fallback Observable to switch to if the source Observable times out
an Observable that mirrors the source Observable, but switches to mirroring a fallback Observable if a item emitted by the source Observable takes longer to arrive than the time window defined by the selector for the previously emitted item
Returns an Observable that mirrors the source Observable, but emits a TimeoutException if an item emitted by the source Observable doesn't arrive within a window of time after the emission of the previous item, where that period of time is measured by an Observable that is a function of the previous item.
Returns an Observable that mirrors the source Observable, but emits a TimeoutException if an item emitted by the source Observable doesn't arrive within a window of time after the emission of the previous item, where that period of time is measured by an Observable that is a function of the previous item.
Note: The arrival of the first source item is never timed out.
a function that returns an observable for each item emitted by the source Observable and that determines the timeout window for the subsequent item
an Observable that mirrors the source Observable, but emits a TimeoutException if a item emitted by the source Observable takes longer to arrive than the time window defined by the selector for the previously emitted item
Applies a timeout policy for each item emitted by the Observable, using the specified scheduler to run timeout timers.
Applies a timeout policy for each item emitted by the Observable, using the specified scheduler to run timeout timers. If the next item isn't observed within the specified timeout duration starting from its predecessor, a specified fallback Observable sequence produces future items and notifications from that point on.
maximum duration between items before a timeout occurs
Observable to use as the fallback in case of a timeout
Scheduler to run the timeout timers on
the source Observable modified so that it will switch to the fallback Observable in case of a timeout
Applies a timeout policy for each item emitted by the Observable, using the specified scheduler to run timeout timers.
Applies a timeout policy for each item emitted by the Observable, using
the specified scheduler to run timeout timers. If the next item isn't
observed within the specified timeout duration starting from its
predecessor, the observer is notified of a TimeoutException
.
maximum duration between items before a timeout occurs
Scheduler to run the timeout timers on
the source Observable modified to notify observers of a
TimeoutException
in case of a timeout
Applies a timeout policy for each item emitted by the Observable, using the specified scheduler to run timeout timers.
Applies a timeout policy for each item emitted by the Observable, using the specified scheduler to run timeout timers. If the next item isn't observed within the specified timeout duration starting from its predecessor, a specified fallback Observable produces future items and notifications from that point on.
maximum duration between items before a timeout occurs
fallback Observable to use in case of a timeout
the source Observable modified to switch to the fallback Observable in case of a timeout
Applies a timeout policy for each item emitted by the Observable, using the specified scheduler to run timeout timers.
Applies a timeout policy for each item emitted by the Observable, using
the specified scheduler to run timeout timers. If the next item isn't
observed within the specified timeout duration starting from its
predecessor, observers are notified of a TimeoutException
.
maximum duration between items before a timeout occurs
the source Observable modified to notify observers of a
TimeoutException
in case of a timeout
Wraps each item emitted by a source Observable in a timestamped tuple with timestamps provided by the given Scheduler.
Wraps each item emitted by a source Observable in a timestamped tuple with timestamps provided by the given Scheduler.
rx.lang.scala.Scheduler to use as a time source.
an Observable that emits timestamped items from the source Observable with timestamps provided by the given Scheduler
Wraps each item emitted by a source Observable in a timestamped tuple.
Wraps each item emitted by a source Observable in a timestamped tuple.
an Observable that emits timestamped items from the source Observable
Returns an Observable that emits a single item, a collection composed of all the items emitted by the source Observable.
Returns an Observable that emits a single item, a collection composed of all the items emitted by the source Observable.
Be careful not to use this operator on Observables that emit infinite or very large numbers of items, as you do not have the option to unsubscribe.
the collection type to build.
an Observable that emits a single item, a collection containing all of the items emitted by the source Observable.
Return an Observable that emits a single Map
containing values corresponding to items emitted by the
source Observable, mapped by the keys returned by a specified keySelector
function.
Return an Observable that emits a single Map
containing values corresponding to items emitted by the
source Observable, mapped by the keys returned by a specified keySelector
function.
the function that extracts the key from a source item to be used in the Map
the function that extracts the value from a source item to be used in the Map
CanBuildFrom
to build the Map
an Observable that emits a single item: a Map
containing the mapped items from the source
Observable
Returns an Observable that emits a single item, an Array
composed of all the items emitted by
the source Observable.
Returns an Observable that emits a single item, an Array
composed of all the items emitted by
the source Observable.
Be careful not to use this operator on Observables that emit infinite or very large numbers of items, as you do not have the option to unsubscribe.
an Observable that emits a single item, an Array
containing all of the items emitted by
the source Observable.
Converts an Observable into a BlockingObservable (an Observable with blocking operators).
Converts an Observable into a BlockingObservable (an Observable with blocking operators).
a BlockingObservable version of this Observable
0.19
Returns an Observable that emits a single item, a Buffer
composed of all the items emitted by
the source Observable.
Returns an Observable that emits a single item, a Buffer
composed of all the items emitted by
the source Observable.
Be careful not to use this operator on Observables that emit infinite or very large numbers of items, as you do not have the option to unsubscribe.
an Observable that emits a single item, a Buffer
containing all of the items emitted by
the source Observable.
Returns an Observable that emits a single item, an IndexedSeq
composed of all the items emitted by
the source Observable.
Returns an Observable that emits a single item, an IndexedSeq
composed of all the items emitted by
the source Observable.
Be careful not to use this operator on Observables that emit infinite or very large numbers of items, as you do not have the option to unsubscribe.
an Observable that emits a single item, an IndexedSeq
containing all of the items emitted by
the source Observable.
Returns an Observable that emits a single item, an Iterable
composed of all the items emitted by
the source Observable.
Returns an Observable that emits a single item, an Iterable
composed of all the items emitted by
the source Observable.
Be careful not to use this operator on Observables that emit infinite or very large numbers of items, as you do not have the option to unsubscribe.
an Observable that emits a single item, an Iterable
containing all of the items emitted by
the source Observable.
Returns an Observable that emits a single item, an Iterator
composed of all the items emitted by
the source Observable.
Returns an Observable that emits a single item, an Iterator
composed of all the items emitted by
the source Observable.
Be careful not to use this operator on Observables that emit infinite or very large numbers of items, as you do not have the option to unsubscribe.
an Observable that emits a single item, an Iterator
containing all of the items emitted by
the source Observable.
Returns an Observable that emits a single item, a List
composed of all the items emitted by
the source Observable.
Returns an Observable that emits a single item, a List
composed of all the items emitted by
the source Observable.
Be careful not to use this operator on Observables that emit infinite or very large numbers of items, as you do not have the option to unsubscribe.
an Observable that emits a single item, a List
containing all of the items emitted by
the source Observable.
Return an Observable that emits a single Map
containing values corresponding to items emitted by the
source Observable, mapped by the keys returned by a specified keySelector
function.
Return an Observable that emits a single Map
containing values corresponding to items emitted by the
source Observable, mapped by the keys returned by a specified keySelector
function.
If more than one source item maps to the same key, the Map
will contain a single entry that
corresponds to the latest of those items.
the function that extracts the key from a source item to be used in the Map
the function that extracts the value from a source item to be used in the Map
an Observable that emits a single item: an Map
containing the mapped items from the source
Observable
Return an Observable that emits a single Map
containing all items emitted by the source Observable,
mapped by the keys returned by a specified keySelector
function.
Return an Observable that emits a single Map
containing all items emitted by the source Observable,
mapped by the keys returned by a specified keySelector
function.
If more than one source item maps to the same key, the Map
will contain the latest of those items.
the function that extracts the key from a source item to be used in the Map
an Observable that emits a single item: an Map
containing the mapped items from the source
Observable
Return an Observable that emits a single Map
containing all pairs emitted by the source Observable.
Return an Observable that emits a single Map
containing all pairs emitted by the source Observable.
This method is unavailable unless the elements are members of (K, V)
. Each (K, V)
becomes a key-value
pair in the map. If more than one pairs have the same key, the Map
will contain the latest of
those items.
an Observable that emits a single item: an Map
containing all pairs from the source Observable
Returns an Observable that emits a single mutable.MultiMap
, returned by a specified multiMapFactory
function, that
contains values extracted by a specified valueSelector
function from items emitted by the source Observable, and
keyed by the keySelector
function.
Returns an Observable that emits a single mutable.MultiMap
, returned by a specified multiMapFactory
function, that
contains values extracted by a specified valueSelector
function from items emitted by the source Observable, and
keyed by the keySelector
function. The values having the same key will be put into a Set
.
the function that extracts a key from the source items to be used as the key in the mutable.MultiMap
the function that extracts a value from the source items to be used as the value in the mutable.MultiMap
a mutable.MultiMap
instance to be used. Note: tis is a by-name parameter.
an Observable that emits a single item: a mutable.MultiMap
that contains keys and values mapped from the source Observable.
Returns an Observable that emits a single mutable.MultiMap
that contains values extracted by a
specified valueSelector
function from items emitted by the source Observable, keyed by a
specified keySelector
function.
Returns an Observable that emits a single mutable.MultiMap
that contains values extracted by a
specified valueSelector
function from items emitted by the source Observable, keyed by a
specified keySelector
function. The values having the same key will be put into a Set
.
the function that extracts a key from the source items to be used as key in the mutable.MultiMap
the function that extracts a value from the source items to be used as value in the mutable.MultiMap
an Observable that emits a single item: a mutable.MultiMap
that contains keys and values mapped from
the source Observable
Returns an Observable that emits a single mutable.MultiMap
that contains items emitted by the
source Observable keyed by a specified keySelector
function.
Returns an Observable that emits a single mutable.MultiMap
that contains items emitted by the
source Observable keyed by a specified keySelector
function. The items having the same
key will be put into a Set
.
the function that extracts the key from the source items to be used as key in the mutable.MultiMap
an Observable that emits a single item: a mutable.MultiMap
that contains items emitted by the
source Observable keyed by a specified keySelector
function.
Returns an Observable that emits a single item, a list composed of all the items emitted by the source Observable.
Returns an Observable that emits a single item, a list composed of all the items emitted by the source Observable.
Normally, an Observable that returns multiple items will do so by invoking its rx.lang.scala.Observer's
onNext method for each such item. You can change
this behavior, instructing the Observable to compose a list of all of these items and then to
invoke the Observer's onNext
function once, passing it the entire list, by
calling the Observable's toList
method prior to calling its Observable.subscribe
method.
Be careful not to use this operator on Observables that emit infinite or very large numbers of items, as you do not have the option to unsubscribe.
an Observable that emits a single item: a List containing all of the items emitted by the source Observable.
Returns an Observable that emits a single item, a Set
composed of all the items emitted by
the source Observable.
Returns an Observable that emits a single item, a Set
composed of all the items emitted by
the source Observable.
Be careful not to use this operator on Observables that emit infinite or very large numbers of items, as you do not have the option to unsubscribe.
an Observable that emits a single item, a Set
containing all of the items emitted by
the source Observable.
Returns an Observable that emits a single item, a Stream
composed of all the items emitted by
the source Observable.
Returns an Observable that emits a single item, a Stream
composed of all the items emitted by
the source Observable.
Be careful not to use this operator on Observables that emit infinite or very large numbers of items, as you do not have the option to unsubscribe.
an Observable that emits a single item, a Stream
containing all of the items emitted by
the source Observable.
Returns an Observable that emits a single item, a Traversable
composed of all the items emitted by
the source Observable.
Returns an Observable that emits a single item, a Traversable
composed of all the items emitted by
the source Observable.
Be careful not to use this operator on Observables that emit infinite or very large numbers of items, as you do not have the option to unsubscribe.
an Observable that emits a single item, a Traversable
containing all of the items emitted by
the source Observable.
Returns an Observable that emits a single item, a Vector
composed of all the items emitted by
the source Observable.
Returns an Observable that emits a single item, a Vector
composed of all the items emitted by
the source Observable.
Be careful not to use this operator on Observables that emit infinite or very large numbers of items, as you do not have the option to unsubscribe.
an Observable that emits a single item, a Vector
containing all of the items emitted by
the source Observable.
Creates an Observable which produces windows of collected values.
Creates an Observable which produces windows of collected values. This Observable produces connected
non-overlapping windows, each of a fixed duration specified by the timespan
argument or a maximum size
specified by the count
argument (which ever is reached first). When the source Observable completes
or encounters an error, the current window is emitted and the event is propagated.
The period of time each window is collecting values before it should be emitted, and replaced with a new window.
The maximum size of each window before it should be emitted.
The rx.lang.scala.Scheduler to use when determining the end and start of a window.
An rx.lang.scala.Observable which produces connected non-overlapping windows which are emitted after a fixed duration or when the window has reached maximum capacity (which ever occurs first).
Creates an Observable which produces windows of collected values.
Creates an Observable which produces windows of collected values. This Observable produces connected
non-overlapping windows, each of a fixed duration specified by the timespan
argument or a maximum size
specified by the count
argument (which ever is reached first). When the source Observable completes
or encounters an error, the current window is emitted and the event is propagated.
The period of time each window is collecting values before it should be emitted, and replaced with a new window.
The maximum size of each window before it should be emitted.
An rx.lang.scala.Observable which produces connected non-overlapping windows which are emitted after a fixed duration or when the window has reached maximum capacity (which ever occurs first).
Creates an Observable which produces windows of collected values.
Creates an Observable which produces windows of collected values. This Observable produces connected
non-overlapping windows, each of a fixed duration specified by the timespan
argument. When the source
Observable completes or encounters an error, the current window is emitted and the event is propagated.
The period of time each window is collecting values before it should be emitted, and replaced with a new window.
The rx.lang.scala.Scheduler to use when determining the end and start of a window.
An rx.lang.scala.Observable which produces connected non-overlapping windows with a fixed duration.
Creates an Observable which produces windows of collected values.
Creates an Observable which produces windows of collected values. This Observable produces connected
non-overlapping windows, each of a fixed duration specified by the timespan
argument. When the source
Observable completes or encounters an error, the current window is emitted and the event is propagated.
The period of time each window is collecting values before it should be emitted, and replaced with a new window.
An rx.lang.scala.Observable which produces connected non-overlapping windows with a fixed duration.
Creates an Observable which produces windows of collected values.
Creates an Observable which produces windows of collected values. This Observable produces connected
non-overlapping windows, each containing count
elements. When the source Observable completes or
encounters an error, the current window is emitted, and the event is propagated.
The maximum size of each window before it should be emitted.
An rx.lang.scala.Observable which produces connected non-overlapping windows containing at most
count
produced values.
Creates an Observable which produces windows of collected values.
Creates an Observable which produces windows of collected values. This Observable produces connected non-overlapping windows. The boundary of each window is determined by the items emitted from a specified boundary-governing Observable.
an Observable whose emitted items close and open windows. Note: This is a by-name parameter, so it is only evaluated when someone subscribes to the returned Observable.
An Observable which produces connected non-overlapping windows. The boundary of each window is determined by the items emitted from a specified boundary-governing Observable.
Returns an Observable that emits non-overlapping buffered items from the source Observable each time the specified boundary Observable emits an item.
Returns an Observable that emits non-overlapping buffered items from the source Observable each time the specified boundary Observable emits an item.
Completion of either the source or the boundary Observable causes the returned Observable to emit the latest buffer and complete.
the boundary Observable
the initial capacity of each buffer chunk
an Observable that emits buffered items from the source Observable when the boundary Observable emits an item
Returns an Observable that emits non-overlapping buffered items from the source Observable each time the specified boundary Observable emits an item.
Returns an Observable that emits non-overlapping buffered items from the source Observable each time the specified boundary Observable emits an item.
Completion of either the source or the boundary Observable causes the returned Observable to emit the latest buffer and complete.
the boundary Observable. Note: This is a by-name parameter, so it is only evaluated when someone subscribes to the returned Observable.
an Observable that emits buffered items from the source Observable when the boundary Observable emits an item
Creates an Observable which produces buffers of collected values.
Creates an Observable which produces buffers of collected values. This Observable produces connected
non-overlapping buffers, each of a fixed duration specified by the timespan
argument or a maximum size
specified by the count
argument (which ever is reached first). When the source Observable completes
or encounters an error, the current buffer is emitted and the event is propagated.
The period of time each buffer is collecting values before it should be emitted, and replaced with a new buffer.
The maximum size of each buffer before it should be emitted.
The rx.lang.scala.Scheduler to use when determining the end and start of a buffer.
An rx.lang.scala.Observable which produces connected non-overlapping buffers which are emitted after a fixed duration or when the buffer has reached maximum capacity (which ever occurs first).
Creates an Observable which produces buffers of collected values.
Creates an Observable which produces buffers of collected values. This Observable produces connected
non-overlapping buffers, each of a fixed duration specified by the timespan
argument or a maximum size
specified by the count
argument (which ever is reached first). When the source Observable completes
or encounters an error, the current buffer is emitted and the event is propagated.
The period of time each buffer is collecting values before it should be emitted, and replaced with a new buffer.
The maximum size of each buffer before it should be emitted.
An rx.lang.scala.Observable which produces connected non-overlapping buffers which are emitted after a fixed duration or when the buffer has reached maximum capacity (which ever occurs first).
Creates an Observable which produces buffers of collected values.
Creates an Observable which produces buffers of collected values.
This Observable produces connected non-overlapping buffers, each of a fixed duration
specified by the timespan
argument. When the source Observable completes or encounters
an error, the current buffer is emitted and the event is propagated.
The period of time each buffer is collecting values before it should be emitted, and replaced with a new buffer.
The rx.lang.scala.Scheduler to use when determining the end and start of a buffer.
An rx.lang.scala.Observable which produces connected non-overlapping buffers with a fixed duration.
Creates an Observable which produces buffers of collected values.
Creates an Observable which produces buffers of collected values.
This Observable produces connected non-overlapping buffers, each of a fixed duration
specified by the timespan
argument. When the source Observable completes or encounters
an error, the current buffer is emitted and the event is propagated.
The period of time each buffer is collecting values before it should be emitted, and replaced with a new buffer.
An rx.lang.scala.Observable which produces connected non-overlapping buffers with a fixed duration.
Creates an Observable which produces buffers of collected values.
Creates an Observable which produces buffers of collected values.
This Observable produces connected non-overlapping buffers, each containing count
elements. When the source Observable completes or encounters an error, the current
buffer is emitted, and the event is propagated.
The maximum size of each buffer before it should be emitted.
An rx.lang.scala.Observable which produces connected non-overlapping buffers containing at most
count
produced values.
Subscribe to Observable and invoke OnSubscribe
function without any
contract protection, error handling, unsubscribe, or execution hooks.
Subscribe to Observable and invoke OnSubscribe
function without any
contract protection, error handling, unsubscribe, or execution hooks.
This should only be used for implementing an Operator
that requires nested subscriptions.
Normal use should use Observable.subscribe
which ensures the Rx contract and other functionality.
Subscription which is the Subscriber passed in
0.17
Asynchronously unsubscribes on the specified Scheduler.
EXPERIMENTAL
Merges the specified Observable into this Observable sequence by using the resultSelector
function only when the source Observable (this instance) emits an item.
EXPERIMENTAL
Merges the specified Observable into this Observable sequence by using the resultSelector
function only when the source Observable (this instance) emits an item.
This method does not operate by default on a particular Scheduler.
the other Observable
the function to call when this Observable emits an item and the other Observable has already emitted an item, to generate the item to be emitted by the resulting Observable
an Observable that merges the specified Observable into this Observable by using the
resultSelector
function only when the source Observable sequence (this instance) emits an item
(if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
Returns an Observable formed from this
Observable and other
Iterable by combining
corresponding elements in pairs.
Returns an Observable formed from this
Observable and other
Iterable by combining
corresponding elements in pairs.
Note that the other
Iterable is evaluated as items are observed from the source Observable; it is
not pre-consumed. This allows you to zip infinite streams on either side.
the Iterable sequence
an Observable that pairs up values from the source Observable and the other
Iterable.
Returns an Observable formed from this Observable and another Observable by combining corresponding elements in pairs.
Returns an Observable formed from this Observable and another Observable by combining
corresponding elements in pairs.
The number of onNext
invocations of the resulting Observable[(T, U)]
is the minumum of the number of onNext
invocations of this
and that
.
the Observable to zip with
an Observable that pairs up values from this
and that
Observables.
Returns an Observable formed from this Observable and another Observable by combining corresponding elements using the selector function.
Returns an Observable formed from this Observable and another Observable by combining
corresponding elements using the selector function.
The number of onNext
invocations of the resulting Observable[(T, U)]
is the minumum of the number of onNext
invocations of this
and that
.
the Observable to zip with
an Observable that pairs up values from this
and that
Observables.
Returns an Observable that emits items that are the result of applying a specified function to pairs of values, one each from the source Observable and a specified Iterable sequence.
Returns an Observable that emits items that are the result of applying a specified function to pairs of values, one each from the source Observable and a specified Iterable sequence.
Note that the other
Iterable is evaluated as items are observed from the source Observable; it is
not pre-consumed. This allows you to zip infinite streams on either side.
the Iterable sequence
a function that combines the pairs of items from the Observable and the Iterable to generate the items to be emitted by the resulting Observable
an Observable that pairs up values from the source Observable and the other
Iterable
sequence and emits the results of selector
applied to these pairs
Zips this Observable with its indices.
Zips this Observable with its indices.
An Observable emitting pairs consisting of all elements of this Observable paired with their index. Indices start at 0.
Caches emissions from the source Observable and replays them in order to any subsequent Subscribers.
Caches emissions from the source Observable and replays them in order to any subsequent Subscribers.
This method has similar behavior to Observable.replay
except that this auto-subscribes to the source
Observable rather than returning a ConnectableObservable for which you must call
connect
to activate the subscription.
This is useful when you want an Observable to cache responses and you can't control the
subscribe/unsubscribe
behavior of all the Subscribers.
When you call cache
, it does not yet subscribe to the source Observable and so does not yet
begin cacheing items. This only happens when the first Subscriber calls the resulting Observable's
subscribe
method.
Note: You sacrifice the ability to unsubscribe from the origin when you use the cache
Observer so be careful not to use this Observer on Observables that emit an infinite or very large number
of items that will use up memory.
This operator does not support upstream backpressure as it is purposefully requesting and caching everything emitted.
cache
does not operate by default on a particular Scheduler
.
hint for number of items to cache (for optimizing underlying data structure)
an Observable that, when first subscribed to, caches all of its items and notifications for the benefit of subsequent subscribers
(Since version 0.26.1) Use Observable.cacheWithInitialCapacity instead
0.20
Registers an function to be called when this Observable invokes onCompleted or onError.
Registers an function to be called when this Observable invokes onCompleted or onError.
an function to be invoked when the source Observable finishes
an Observable that emits the same items as the source Observable, then invokes the function
(Since version 0.26.1) Use Observable.doAfterTerminate instead
Flattens an Observable that emits Observables into one Observable, in a way that allows an Observer to receive all successfully emitted items from all of the source Observables without being interrupted by an error notification from one of them, while limiting the number of concurrent subscriptions to these Observables.
Flattens an Observable that emits Observables into one Observable, in a way that allows an Observer to receive all successfully emitted items from all of the source Observables without being interrupted by an error notification from one of them, while limiting the number of concurrent subscriptions to these Observables.
This behaves like flatten
except that if any of the merged Observables notify of an
error via onError
, flattenDelayError
will refrain from propagating that
error notification until all of the merged Observables have finished emitting items.
Even if multiple merged Observables send onError
notifications, flattenDelayError
will only
invoke the onError
method of its Observer
s once.
This method does not operate by default on a particular Scheduler.
an Observable that emits all of the items emitted by the Observables emitted by this
(Since version 0.26.2) Use delayError.flatten instead
This behaves like rx.lang.scala.Observable.merge except that if any of the merged Observables
notify of an error via onError, mergeDelayError
will
refrain from propagating that error notification until all of the merged Observables have
finished emitting items.
This behaves like rx.lang.scala.Observable.merge except that if any of the merged Observables
notify of an error via onError, mergeDelayError
will
refrain from propagating that error notification until all of the merged Observables have
finished emitting items.
Even if multiple merged Observables send onError
notifications, mergeDelayError
will only invoke the onError
method of its
Observers once.
This method allows an Observer to receive all successfully emitted items from all of the source Observables without being interrupted by an error notification from one of them.
an Observable to be merged
an Observable that emits items that are the result of flattening the items emitted by
this
and that
(Since version 0.26.2) Use delayError.merge instead
The Observable interface that implements the Reactive Pattern.