Class/Object

rx.lang.scala.subjects

SerializedSubject

Related Docs: object SerializedSubject | package subjects

Permalink

class SerializedSubject[T] extends Subject[T]

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SerializedSubject
  2. Subject
  3. Observer
  4. Observable
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def ++[U >: T](that: Observable[U]): Observable[U]

    Permalink

    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.

    that

    an Observable to be appended

    returns

    an Observable that emits items that are the result of combining the items emitted by this and that, one after the other

    Definition Classes
    Observable
  4. def +:[U >: T](elem: U): Observable[U]

    Permalink

    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.

    elem

    the item to emit

    returns

    an Observable that emits the specified item before it begins to emit items emitted by the source Observable

    Definition Classes
    Observable
  5. def :+[U >: T](elem: U): Observable[U]

    Permalink

    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.

    elem

    the item to be appended

    returns

    an Observable that first emits the items emitted by this, and then elem.

    Definition Classes
    Observable
  6. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  7. def amb[U >: T](that: Observable[U]): Observable[U]

    Permalink

    Given two Observables, mirror the one that first emits an item.

    Given two Observables, mirror the one that first emits an item.

    that

    an Observable competing to react first

    returns

    an Observable that emits the same sequence of items as whichever of this or that first emitted an item.

    Definition Classes
    Observable
  8. def apply(subscriber: Subscriber[T]): Subscription

    Permalink

    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.

    Scheduler:

    This method does not operate by default on a particular Scheduler.

    subscriber

    the Subscriber

    returns

    a rx.lang.scala.Subscription reference whose unsubscribe method can be called to stop receiving items before the Observable has finished sending them

    Definition Classes
    Observable
    See also

    ReactiveX operators documentation: Subscribe

  9. def apply(observer: Observer[T]): Subscription

    Permalink

    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.

    Scheduler:

    This method does not operate by default on a particular Scheduler.

    observer

    the observer

    returns

    a rx.lang.scala.Subscription reference whose unsubscribe method can be called to stop receiving items before the Observable has finished sending them

    Definition Classes
    Observable
    See also

    ReactiveX operators documentation: Subscribe

  10. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  11. val asJavaObservable: rx.Observable[_ <: T]

    Permalink
    Definition Classes
    SubjectObservable
  12. val asJavaObserver: rx.Observer[_ >: T]

    Permalink
    Definition Classes
    SubjectObserver
  13. val asJavaSubject: subjects.SerializedSubject[_ >: T, _ <: T]

    Permalink
    Definition Classes
    SerializedSubjectSubject
  14. def cache: Observable[T]

    Permalink

    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.

    returns

    an Observable that when first subscribed to, caches all of its notifications for the benefit of subsequent subscribers.

    Definition Classes
    Observable
  15. def cacheWithInitialCapacity(capacity: Int): Observable[T]

    Permalink

    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.

    Backpressure Support:

    This operator does not support upstream backpressure as it is purposefully requesting and caching everything emitted.

    Scheduler:

    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.

    capacity

    hint for number of items to cache (for optimizing underlying data structure)

    returns

    an Observable that, when first subscribed to, caches all of its items and notifications for the benefit of subsequent Subscribers

    Definition Classes
    Observable
    See also

    ReactiveX operators documentation: Replay

  16. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  17. def collect[R](pf: PartialFunction[T, R]): Observable[R]

    Permalink

    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.

    R

    the element type of the returned Observable.

    pf

    the partial function which filters and maps the Observable.

    returns

    a new Observable by applying a partial function to all elements of this Observable on which the function is defined.

    Definition Classes
    Observable
  18. def combineLatest[U](that: Observable[U]): Observable[(T, U)]

    Permalink

    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.

    that

    The second source observable.

    returns

    An Observable that combines the source Observables

    Definition Classes
    Observable
  19. def combineLatestWith[U, R](that: Observable[U])(selector: (T, U) ⇒ R): Observable[R]

    Permalink

    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.

    that

    The second source observable.

    selector

    The function that is used combine the emissions of the two observables.

    returns

    An Observable that combines the source Observables according to the function selector.

    Definition Classes
    Observable
  20. def concat[U]: Observable[U]

    Permalink

    [use case]

    [use case]
    Definition Classes
    Observable
    Full Signature

    def concat[U](implicit evidence: <:<[Observable[T], Observable[Observable[U]]]): Observable[U]

  21. def concatEager[U](capacityHint: Int)(implicit evidence: <:<[Observable[T], Observable[Observable[U]]]): Observable[U]

    Permalink

    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:

    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.

    Scheduler:

    This method does not operate by default on a particular Scheduler.

    capacityHint

    hints about the number of expected values in an Observable

    returns

    an Observable that emits items all of the items emitted by the Observables emitted by this, one after the other, without interleaving them

    Definition Classes
    Observable
    Annotations
    @Experimental()
    Since

    (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)

  22. def concatEager[U](implicit evidence: <:<[Observable[T], Observable[Observable[U]]]): Observable[U]

    Permalink

    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:

    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.

    Scheduler:

    This method does not operate by default on a particular Scheduler.

    returns

    an Observable that emits items all of the items emitted by the Observables emitted by this, one after the other, without interleaving them

    Definition Classes
    Observable
    Annotations
    @Experimental()
    Since

    (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)

  23. def concatEager[U >: T](that: Observable[U]): Observable[U]

    Permalink

    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:

    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.

    Scheduler:

    This method does not operate by default on a particular Scheduler.

    that

    the source to concat with.

    returns

    an Observable that emits items all of the items emitted by this and that, one after the other, without interleaving them.

    Definition Classes
    Observable
    Annotations
    @Experimental()
    Since

    (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)

  24. def concatMap[R](f: (T) ⇒ Observable[R]): Observable[R]

    Permalink

    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.

    f

    a function that, when applied to an item emitted by the source Observable, returns an Observable

    returns

    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

    Definition Classes
    Observable
  25. def concatMapEager[R](capacityHint: Int, maxConcurrent: Int, f: (T) ⇒ Observable[R]): Observable[R]

    Permalink

    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:

    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.

    Scheduler:

    This method does not operate by default on a particular Scheduler.

    capacityHint

    hints about the number of expected source sequence values

    maxConcurrent

    the maximum number of concurrent subscribed Observables

    f

    the function that maps a sequence of values into a sequence of Observables that will be eagerly concatenated

    returns

    an Observable that emits items all of the items emitted by the Observables returned by f, one after the other, without interleaving them

    Definition Classes
    Observable
    Annotations
    @Experimental()
  26. def concatMapEager[R](capacityHint: Int, f: (T) ⇒ Observable[R]): Observable[R]

    Permalink

    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:

    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.

    Scheduler:

    This method does not operate by default on a particular Scheduler.

    capacityHint

    hints about the number of expected values in an Observable

    f

    the function that maps a sequence of values into a sequence of Observables that will be eagerly concatenated

    returns

    an Observable that emits items all of the items emitted by the Observables returned by f, one after the other, without interleaving them

    Definition Classes
    Observable
    Annotations
    @Experimental()
    Since

    (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)

  27. def concatMapEager[R](f: (T) ⇒ Observable[R]): Observable[R]

    Permalink

    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:

    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.

    Scheduler:

    This method does not operate by default on a particular Scheduler.

    f

    the function that maps a sequence of values into a sequence of Observables that will be eagerly concatenated

    returns

    an Observable that emits items all of the items emitted by the Observables returned by f, one after the other, without interleaving them

    Definition Classes
    Observable
    Annotations
    @Experimental()
    Since

    (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)

  28. def contains[U >: T](elem: U): Observable[Boolean]

    Permalink

    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.

    elem

    the item to search for in the emissions from the source Observable

    returns

    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

    Definition Classes
    Observable
  29. def count(p: (T) ⇒ Boolean): Observable[Int]

    Permalink

    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.

    p

    the predicate used to test elements.

    returns

    an Observable which emits the number of elements in the source Observable which satisfy a predicate.

    Definition Classes
    Observable
  30. def countLong: Observable[Long]

    Permalink

    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>

    This operator does not support backpressure because by intent it will receive all values and reduce them to a single `onNext`.
    <dt>Scheduler:</dt>
    `countLong` does not operate by default on a particular `Scheduler`.
    </dl>

    returns

    an Observable that emits a single item: the number of items emitted by the source Observable as a 64-bit Long item

    Definition Classes
    Observable
    See also

    #count()

    MSDN: Observable.LongCount

    RxJava wiki: countLong

  31. def debounce(timeout: Duration, scheduler: Scheduler): Observable[T]

    Permalink

    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:

    timeout

    The time each value has to be 'the most recent' of the rx.lang.scala.Observable to ensure that it's not dropped.

    scheduler

    The rx.lang.scala.Scheduler to use internally to manage the timers which handle timeout for each event.

    returns

    Observable which performs the throttle operation.

    Definition Classes
    Observable
    See also

    Observable.throttleWithTimeout

  32. def debounce(timeout: Duration): Observable[T]

    Permalink

    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:

    timeout

    The time each value has to be 'the most recent' of the rx.lang.scala.Observable to ensure that it's not dropped.

    returns

    An rx.lang.scala.Observable which filters out values which are too quickly followed up with newer values.

    Definition Classes
    Observable
    See also

    Observable.throttleWithTimeout

  33. def debounce(debounceSelector: (T) ⇒ Observable[Any]): Observable[T]

    Permalink

    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.

    debounceSelector

    function to retrieve a sequence that indicates the throttle duration for each item

    returns

    an Observable that omits items emitted by the source Observable that are followed by another item within a computed debounce duration

    Definition Classes
    Observable
  34. def delay(subscriptionDelay: () ⇒ Observable[Any], itemDelay: (T) ⇒ Observable[Any]): Observable[T]

    Permalink

    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.

    subscriptionDelay

    a function that returns an Observable that triggers the subscription to the source Observable once it emits any item

    itemDelay

    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

    returns

    an Observable that delays the subscription and emissions of the source Observable via another Observable on a per-item basis

    Definition Classes
    Observable
  35. def delay(itemDelay: (T) ⇒ Observable[Any]): Observable[T]

    Permalink

    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.

    itemDelay

    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

    returns

    an Observable that delays the emissions of the source Observable via another Observable on a per-item basis

    Definition Classes
    Observable
  36. def delay(delay: Duration, scheduler: Scheduler): Observable[T]

    Permalink

    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.

    delay

    the delay to shift the source by

    scheduler

    the Scheduler to use for delaying

    returns

    the source Observable shifted in time by the specified delay

    Definition Classes
    Observable
  37. def delay(delay: Duration): Observable[T]

    Permalink

    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.

    delay

    the delay to shift the source by

    returns

    the source Observable shifted in time by the specified delay

    Definition Classes
    Observable
  38. def delayError: ErrorDelayingObservable[T]

    Permalink

    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.

    Definition Classes
    Observable
    Annotations
    @Experimental()
  39. def delaySubscription(subscriptionDelay: () ⇒ Observable[Any]): Observable[T]

    Permalink

    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>

    This version of `delay` operates by default on the `computation` `Scheduler`.
    </dl>

    subscriptionDelay

    a function that returns an Observable that triggers the subscription to the source Observable once it emits any item

    returns

    an Observable that delays the subscription to the source Observable until the Observable returned by subscriptionDelay emits an item

    Definition Classes
    Observable
    See also

    RxJava wiki: delaySubscription

  40. def delaySubscription(delay: Duration, scheduler: Scheduler): Observable[T]

    Permalink

    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.

    delay

    the time to delay the subscription

    scheduler

    the Scheduler on which the waiting and subscription will happen

    returns

    an Observable that delays the subscription to the source Observable by a given amount, waiting and subscribing on the given Scheduler

    Definition Classes
    Observable
  41. def delaySubscription(delay: Duration): Observable[T]

    Permalink

    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.

    delay

    the time to delay the subscription

    returns

    an Observable that delays the subscription to the source Observable by the given amount

    Definition Classes
    Observable
  42. def dematerialize[U]: Observable[U]

    Permalink

    [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.

    [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.

    This operation is only available if this is of type Observable[Notification[U]] for some U, otherwise you will get a compilation error.

    returns

    an Observable that emits the items and notifications embedded in the rx.lang.scala.Notification objects emitted by the source Observable

    Definition Classes
    Observable
    Full Signature

    def dematerialize[U](implicit evidence: <:<[Observable[T], Observable[Notification[U]]]): Observable[U]

  43. def distinct[U](keySelector: (T) ⇒ U): Observable[T]

    Permalink

    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.

    keySelector

    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

    returns

    an Observable of distinct items

    Definition Classes
    Observable
  44. def distinct: Observable[T]

    Permalink

    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.

    returns

    an Observable of distinct items

    Definition Classes
    Observable
  45. def distinctUntilChanged[U](keySelector: (T) ⇒ U): Observable[T]

    Permalink

    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.

    keySelector

    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

    returns

    an Observable of sequentially distinct items

    Definition Classes
    Observable
  46. def distinctUntilChanged: Observable[T]

    Permalink

    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.

    returns

    an Observable of sequentially distinct items

    Definition Classes
    Observable
  47. def doAfterTerminate(action: ⇒ Unit): Observable[T]

    Permalink

    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.

    Scheduler:

    This method does not operate by default on a particular Scheduler.

    action

    an function to be invoked when the source Observable finishes

    returns

    an Observable that emits the same items as the source Observable, then invokes the action

    Definition Classes
    Observable
    See also

    ReactiveX operators documentation: Do

  48. def doOnCompleted(onCompleted: ⇒ Unit): Observable[T]

    Permalink

    Invokes an action when the source Observable calls onCompleted.

    Invokes an action when the source Observable calls onCompleted.

    onCompleted

    the action to invoke when the source Observable calls onCompleted

    returns

    the source Observable with the side-effecting behavior applied

    Definition Classes
    Observable
  49. def doOnEach(onNext: (T) ⇒ Unit, onError: (Throwable) ⇒ Unit, onCompleted: () ⇒ Unit): Observable[T]

    Permalink

    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.

    onNext

    this function will be called whenever the Observable emits an item

    onError

    this function will be called if an error occurs

    onCompleted

    the action to invoke when the source Observable calls

    returns

    an Observable with the side-effecting behavior applied.

    Definition Classes
    Observable
  50. def doOnEach(onNext: (T) ⇒ Unit, onError: (Throwable) ⇒ Unit): Observable[T]

    Permalink

    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.

    onNext

    this function will be called whenever the Observable emits an item

    onError

    this function will be called if an error occurs

    returns

    an Observable with the side-effecting behavior applied.

    Definition Classes
    Observable
  51. def doOnEach(onNext: (T) ⇒ Unit): Observable[T]

    Permalink

    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.

    onNext

    this function will be called whenever the Observable emits an item

    returns

    an Observable with the side-effecting behavior applied.

    Definition Classes
    Observable
  52. def doOnEach(observer: Observer[T]): Observable[T]

    Permalink

    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.

    observer

    the observer

    returns

    an Observable with the side-effecting behavior applied.

    Definition Classes
    Observable
  53. def doOnError(onError: (Throwable) ⇒ Unit): Observable[T]

    Permalink

    Invokes an action if the source Observable calls onError.

    Invokes an action if the source Observable calls onError.

    onError

    the action to invoke if the source Observable calls onError

    returns

    the source Observable with the side-effecting behavior applied

    Definition Classes
    Observable
  54. def doOnNext(onNext: (T) ⇒ Unit): Observable[T]

    Permalink

    Invokes an action when the source Observable calls onNext.

    Invokes an action when the source Observable calls onNext.

    onNext

    the action to invoke when the source Observable calls onNext

    returns

    the source Observable with the side-effecting behavior applied

    Definition Classes
    Observable
  55. def doOnRequest(onRequest: (Long) ⇒ Unit): Observable[T]

    Permalink

    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.

    Scheduler:

    This method does not operate by default on a particular Scheduler.

    onRequest

    the action that gets called when an Observer requests items from this Observable

    returns

    an Observable that will call onRequest when appropriate

    Definition Classes
    Observable
    Annotations
    @Beta()
    Since

    (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)

    See also

    ReactiveX operators documentation: Do

  56. def doOnSubscribe(onSubscribe: ⇒ Unit): Observable[T]

    Permalink

    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>

    `onSubscribe` does not operate by default on a particular `Scheduler`.
    </dl>

    onSubscribe

    the action that gets called when an observer subscribes to this Observable

    returns

    the source Observable modified so as to call this Action when appropriate

    Definition Classes
    Observable
    Since

    0.20

    See also

    RxJava wiki: doOnSubscribe

  57. def doOnTerminate(onTerminate: ⇒ Unit): Observable[T]

    Permalink

    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.

    onTerminate

    the action to invoke when the source Observable calls onCompleted or onError

    returns

    the source Observable with the side-effecting behavior applied

    Definition Classes
    Observable
    See also

    MSDN: Observable.Do

    RxJava Wiki: doOnTerminate()

  58. def doOnUnsubscribe(onUnsubscribe: ⇒ Unit): Observable[T]

    Permalink

    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>

    `doOnUnsubscribe` does not operate by default on a particular `Scheduler`.
    </dl>

    onUnsubscribe

    the action that gets called when this Observable is unsubscribed

    returns

    the source Observable modified so as to call this Action when appropriate

    Definition Classes
    Observable
    Since

    0.20

    See also

    RxJava wiki: doOnUnsubscribe

  59. def drop(time: Duration, scheduler: Scheduler): Observable[T]

    Permalink

    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.

    time

    the length of the time window to drop

    scheduler

    the Scheduler on which the timed wait happens

    returns

    an Observable that drops values emitted by the source Observable before the time window defined by time elapses and emits the remainder

    Definition Classes
    Observable
  60. def drop(time: Duration): Observable[T]

    Permalink

    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.

    time

    the length of the time window to drop

    returns

    an Observable that drops values emitted by the source Observable before the time window defined by time elapses and emits the remainder

    Definition Classes
    Observable
  61. def drop(n: Int): Observable[T]

    Permalink

    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.

    n

    the number of items to skip

    returns

    an Observable that is identical to the source Observable except that it does not emit the first num items that the source emits

    Definition Classes
    Observable
  62. def dropRight(time: Duration, scheduler: Scheduler): Observable[T]

    Permalink

    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.

    time

    the length of the time window

    scheduler

    the scheduler used as the time source

    returns

    an Observable that drops those items emitted by the source Observable in a time window before the source completes defined by time and scheduler

    Definition Classes
    Observable
  63. def dropRight(time: Duration): Observable[T]

    Permalink

    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.

    time

    the length of the time window

    returns

    an Observable that drops those items emitted by the source Observable in a time window before the source completes defined by time

    Definition Classes
    Observable
  64. def dropRight(n: Int): Observable[T]

    Permalink

    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.

    n

    number of items to drop from the end of the source sequence

    returns

    an Observable that emits the items emitted by the source Observable except for the dropped ones at the end

    Definition Classes
    Observable
    Exceptions thrown

    java.lang.IndexOutOfBoundsException if n is less than zero

  65. def dropUntil(other: Observable[Any]): Observable[T]

    Permalink

    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.

    other

    the second Observable that has to emit an item before the source Observable's elements begin to be mirrored by the resulting Observable

    returns

    an Observable that skips items from the source Observable until the second Observable emits an item, then emits the remaining items

    Definition Classes
    Observable
    See also

    MSDN: Observable.SkipUntil

    RxJava Wiki: skipUntil()

  66. def dropWhile(predicate: (T) ⇒ Boolean): Observable[T]

    Permalink

    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.

    predicate

    A function to test each item emitted from the source Observable for a condition.

    returns

    an Observable that emits all items from the source Observable as soon as the condition becomes false.

    Definition Classes
    Observable
  67. def elementAt(index: Int): Observable[T]

    Permalink

    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.

    index

    the zero-based index of the item to retrieve

    returns

    an Observable that emits a single item: the item at the specified position in the sequence of those emitted by the source Observable

    Definition Classes
    Observable
    Exceptions thrown

    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

  68. def elementAtOrDefault[U >: T](index: Int, default: U): Observable[U]

    Permalink

    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.

    index

    the zero-based index of the item to retrieve

    default

    the default item

    returns

    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

    Definition Classes
    Observable
    Exceptions thrown

    java.lang.IndexOutOfBoundsException if index is less than 0

  69. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  70. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  71. def exists(p: (T) ⇒ Boolean): Observable[Boolean]

    Permalink

    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.

    p

    the predicate used to test elements.

    returns

    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.

    Definition Classes
    Observable
  72. def filter(predicate: (T) ⇒ Boolean): Observable[T]

    Permalink

    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.

    predicate

    a function that evaluates the items emitted by the source Observable, returning true if they pass the filter

    returns

    an Observable that emits only those items in the original Observable that the filter evaluates as true

    Definition Classes
    Observable
  73. def filterNot(p: (T) ⇒ Boolean): Observable[T]

    Permalink

    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.

    p

    the predicate used to test elements.

    returns

    Returns an Observable which only emits elements which do not satisfy a predicate.

    Definition Classes
    Observable
  74. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  75. def first: Observable[T]

    Permalink

    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.

    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

    Definition Classes
    Observable
    See also

    "MSDN: Observable.firstAsync()"

    RxJava Wiki: first()

  76. def firstOrElse[U >: T](default: ⇒ U): Observable[U]

    Permalink

    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.

    default

    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.

    returns

    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.

    Definition Classes
    Observable
  77. def flatMap[R](maxConcurrent: Int, onNext: (T) ⇒ Observable[R], onError: (Throwable) ⇒ Observable[R], onCompleted: () ⇒ Observable[R]): Observable[R]

    Permalink

    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.

    Scheduler:

    This method does not operate by default on a particular Scheduler.

    maxConcurrent

    the maximum number of Observables that may be subscribed to concurrently

    onNext

    a function that returns an Observable to merge for each item emitted by the source Observable

    onError

    a function that returns an Observable to merge for an onError notification from the source Observable

    onCompleted

    a function that returns an Observable to merge for an onCompleted notification from the source Observable

    returns

    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

    Definition Classes
    Observable
    Annotations
    @Beta()
    Since

    (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)

    See also

    ReactiveX operators documentation: FlatMap

  78. def flatMap[R](onNext: (T) ⇒ Observable[R], onError: (Throwable) ⇒ Observable[R], onCompleted: () ⇒ Observable[R]): Observable[R]

    Permalink

    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.

    R

    the result type

    onNext

    a function that returns an Observable to merge for each item emitted by the source Observable

    onError

    a function that returns an Observable to merge for an onError notification from the source Observable

    onCompleted

    a function that returns an Observable to merge for an onCompleted notification from the source Observable

    returns

    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

    Definition Classes
    Observable
  79. def flatMap[R](maxConcurrent: Int, f: (T) ⇒ Observable[R]): Observable[R]

    Permalink

    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

    maxConcurrent

    the maximum number of Observables that may be subscribed to concurrently

    f

    a function that, when applied to an item emitted by the source Observable, returns an Observable

    returns

    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

    Definition Classes
    Observable
    Annotations
    @Beta()
    Since

    (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)

    See also

    ReactiveX operators documentation: FlatMap

  80. def flatMap[R](f: (T) ⇒ Observable[R]): Observable[R]

    Permalink

    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.

    f

    a function that, when applied to an item emitted by the source Observable, returns an Observable

    returns

    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.

    Definition Classes
    Observable
  81. def flatMapIterable[R](collectionSelector: (T) ⇒ Iterable[R]): Observable[R]

    Permalink

    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.

    R

    the type of item emitted by the resulting Observable

    collectionSelector

    a function that returns an Iterable sequence of values for when given an item emitted by the source Observable

    returns

    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

    Definition Classes
    Observable
  82. def flatMapIterableWith[U, R](collectionSelector: (T) ⇒ Iterable[U])(resultSelector: (T, U) ⇒ R): Observable[R]

    Permalink

    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.

    U

    the collection element type

    R

    the type of item emited by the resulting Observable

    collectionSelector

    a function that returns an Iterable sequence of values for each item emitted by the source Observable

    resultSelector

    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

    returns

    an Observable that emits the items returned by resultSelector for each item in the source Observable

    Definition Classes
    Observable
  83. def flatMapWith[U, R](maxConcurrent: Int, collectionSelector: (T) ⇒ Observable[U])(resultSelector: (T, U) ⇒ R): Observable[R]

    Permalink

    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.

    U

    the type of items emitted by the collection Observable

    R

    the type of items emitted by the resulting Observable

    maxConcurrent

    the maximum number of Observables that may be subscribed to concurrently

    collectionSelector

    a function that returns an Observable for each item emitted by the source Observable

    resultSelector

    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

    returns

    an Observable that emits the results of applying a function to a pair of values emitted by the source Observable and the collection Observable

    Definition Classes
    Observable
    Annotations
    @Beta()
  84. def flatMapWith[U, R](collectionSelector: (T) ⇒ Observable[U])(resultSelector: (T, U) ⇒ R): Observable[R]

    Permalink

    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.

    U

    the type of items emitted by the collection Observable

    R

    the type of items emitted by the resulting Observable

    collectionSelector

    a function that returns an Observable for each item emitted by the source Observable

    resultSelector

    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

    returns

    an Observable that emits the results of applying a function to a pair of values emitted by the source Observable and the collection Observable

    Definition Classes
    Observable
  85. def flatten[U](maxConcurrent: Int)(implicit evidence: <:<[Observable[T], Observable[Observable[U]]]): Observable[U]

    Permalink

    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.

    maxConcurrent

    the maximum number of Observables that may be subscribed to concurrently

    returns

    an Observable that emits items that are the result of flattening the Observables emitted by the source Observable

    Definition Classes
    Observable
    Exceptions thrown

    java.lang.IllegalArgumentException if maxConcurrent is less than or equal to 0

  86. def flatten[U]: Observable[U]

    Permalink

    [use case] Flattens the sequence of Observables emitted by this into one Observable, without any transformation.

    [use case]

    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.

    returns

    an Observable that emits items that are the result of flattening the items emitted by the Observables emitted by this

    Definition Classes
    Observable
    Full Signature

    def flatten[U](implicit evidence: <:<[Observable[T], Observable[Observable[U]]]): Observable[U]

  87. def foldLeft[R](initialValue: R)(accumulator: (R, T) ⇒ R): Observable[R]

    Permalink

    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.

    initialValue

    the initial (seed) accumulator value

    accumulator

    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

    returns

    an Observable that emits a single item that is the result of accumulating the output from the items emitted by the source Observable

    Definition Classes
    Observable
  88. def forall(predicate: (T) ⇒ Boolean): Observable[Boolean]

    Permalink

    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.

    predicate

    a function that evaluates an item and returns a Boolean

    returns

    an Observable that emits true if all items emitted by the source Observable satisfy the predicate; otherwise, false

    Definition Classes
    Observable
  89. def foreach(onNext: (T) ⇒ Unit, onError: (Throwable) ⇒ Unit, onComplete: () ⇒ Unit): Unit

    Permalink

    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).

    Scheduler:

    This method does not operate by default on a particular Scheduler.

    onNext

    function to execute for each item.

    onError

    function to execute when an error is emitted.

    onComplete

    function to execute when completion is signalled.

    Definition Classes
    Observable
    Since

    0.19

    Exceptions thrown

    java.lang.IllegalArgumentException if onNext is null, or if onError is null, or if onComplete is null

    See also

    ReactiveX operators documentation: Subscribe

  90. def foreach(onNext: (T) ⇒ Unit, onError: (Throwable) ⇒ Unit): Unit

    Permalink

    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).

    Scheduler:

    This method does not operate by default on a particular Scheduler.

    onNext

    function to execute for each item.

    onError

    function to execute when an error is emitted.

    Definition Classes
    Observable
    Since

    0.19

    Exceptions thrown

    java.lang.IllegalArgumentException if onNext is null, or if onError is null

    See also

    ReactiveX operators documentation: Subscribe

  91. def foreach(onNext: (T) ⇒ Unit): Unit

    Permalink

    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).

    Scheduler:

    This method does not operate by default on a particular Scheduler.

    onNext

    function to execute for each item.

    Definition Classes
    Observable
    Since

    0.19

    Exceptions thrown

    java.lang.IllegalArgumentException if onNext is null

    rx.exceptions.OnErrorNotImplementedException if the Observable tries to call onError

    See also

    ReactiveX operators documentation: Subscribe

  92. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  93. def groupBy[K, V](keySelector: (T) ⇒ K, valueSelector: (T) ⇒ V): Observable[(K, Observable[V])]

    Permalink

    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.

    Backpressure Support:

    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`.

    K

    the key type

    V

    the value type

    keySelector

    a function that extracts the key for each item

    valueSelector

    a function that extracts the return element for each item

    returns

    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

    Definition Classes
    Observable
    See also

    MSDN: Observable.GroupBy

    RxJava wiki: groupBy

  94. def groupBy[K](f: (T) ⇒ K): Observable[(K, Observable[T])]

    Permalink

    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.

    K

    the type of keys returned by the discriminator function.

    f

    a function that extracts the key from an item

    returns

    an Observable that emits (key, observable) pairs, where observable contains all items for which f returned key.

    Definition Classes
    Observable
  95. def groupJoin[S, R](other: Observable[S])(leftDuration: (T) ⇒ Observable[Any], rightDuration: (S) ⇒ Observable[Any], resultSelector: (T, Observable[S]) ⇒ R): Observable[R]

    Permalink

    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.

    other

    the other Observable to correlate items from the source Observable with

    leftDuration

    a function that returns an Observable whose emissions indicate the duration of the values of the source Observable

    rightDuration

    a function that returns an Observable whose emissions indicate the duration of the values of the other Observable

    resultSelector

    a function that takes an item emitted by each Observable and returns the value to be emitted by the resulting Observable

    returns

    an Observable that emits items based on combining those items emitted by the source Observables whose durations overlap

    Definition Classes
    Observable
  96. def hasObservers: Boolean

    Permalink

    Indicates whether the Subject has Observers subscribed to it.

    Indicates whether the Subject has Observers subscribed to it.

    returns

    true if there is at least one Observer subscribed to this Subject, false otherwise

    Definition Classes
    Subject
  97. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  98. def head: Observable[T]

    Permalink

    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.

    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

    Definition Classes
    Observable
    See also

    Observable.first

    "MSDN: Observable.firstAsync()"

    RxJava Wiki: first()

  99. def headOption: Observable[Option[T]]

    Permalink

    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.

    returns

    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.

    Definition Classes
    Observable
  100. def headOrElse[U >: T](default: ⇒ U): Observable[U]

    Permalink

    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.

    default

    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.

    returns

    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.

    Definition Classes
    Observable
  101. def isEmpty: Observable[Boolean]

    Permalink

    Tests whether this Observable emits no elements.

    Tests whether this Observable emits no elements.

    returns

    an Observable emitting one single Boolean, which is true if this Observable emits no elements, and false otherwise.

    Definition Classes
    Observable
  102. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  103. def join[S, R](other: Observable[S])(leftDurationSelector: (T) ⇒ Observable[Any], rightDurationSelector: (S) ⇒ Observable[Any], resultSelector: (T, S) ⇒ R): Observable[R]

    Permalink

    Correlates the items emitted by two Observables based on overlapping durations.

    Correlates the items emitted by two Observables based on overlapping durations.

    other

    the second Observable to join items from

    leftDurationSelector

    a function to select a duration for each item emitted by the source Observable, used to determine overlap

    rightDurationSelector

    a function to select a duration for each item emitted by the inner Observable, used to determine overlap

    resultSelector

    a function that computes an item to be emitted by the resulting Observable for any two overlapping items emitted by the two Observables

    returns

    an Observable that emits items correlating to items emitted by the source Observables that have overlapping durations

    Definition Classes
    Observable
    See also

    MSDN: Observable.Join

    RxJava Wiki: join()

  104. def last: Observable[T]

    Permalink

    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.

    returns

    an Observable that emits the last item from the source Observable or notifies observers of an error

    Definition Classes
    Observable
    See also

    "MSDN: Observable.lastAsync()"

    RxJava Wiki: last()

  105. def lastOption: Observable[Option[T]]

    Permalink

    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.

    returns

    an Observable that emits only an Option with the last item emitted by the source Observable, or None if the source Observable is empty

    Definition Classes
    Observable
  106. def lastOrElse[U >: T](default: ⇒ U): Observable[U]

    Permalink

    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.

    default

    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.

    returns

    an Observable that emits only the last item emitted by the source Observable, or a default item if the source Observable is empty

    Definition Classes
    Observable
  107. def length: Observable[Int]

    Permalink

    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.

    returns

    an Observable emitting the number of counted elements of the source Observable as its single item.

    Definition Classes
    Observable
  108. def lift[R](operator: (Subscriber[R]) ⇒ Subscriber[T]): Observable[R]

    Permalink

    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>

    `lift` does not operate by default on a particular [[Scheduler]].
    </dl>

    operator

    the Operator that implements the Observable-operating function to be applied to the source Observable

    returns

    an Observable that is the result of applying the lifted Operator to the source Observable

    Definition Classes
    Observable
    Since

    0.17

    See also

    RxJava wiki: Implementing Your Own Operators

  109. def map[R](func: (T) ⇒ R): Observable[R]

    Permalink

    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.

    func

    a function to apply to each item emitted by the Observable

    returns

    an Observable that emits the items from the source Observable, transformed by the given function

    Definition Classes
    Observable
  110. def materialize: Observable[Notification[T]]

    Permalink

    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.

    returns

    an Observable whose items are the result of materializing the items and notifications of the source Observable

    Definition Classes
    Observable
  111. def merge[U >: T](that: Observable[U]): Observable[U]

    Permalink

    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.

    that

    an Observable to be merged

    returns

    an Observable that emits items from this and that until this or that emits onError or both Observables emit onCompleted.

    Definition Classes
    Observable
  112. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  113. def nest: Observable[Observable[T]]

    Permalink

    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.

    returns

    an Observable that emits a single item: the source Observable

    Definition Classes
    Observable
  114. def nonEmpty: Observable[Boolean]

    Permalink

    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.

    returns

    an Observable emitting one single Boolean, which is true if the source Observable emits any element, and false otherwise.

    Definition Classes
    Observable
  115. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  116. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  117. def observeOn(scheduler: Scheduler, delayError: Boolean, bufferSize: Int): Observable[T]

    Permalink

    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.

    Scheduler:

    you specify which Scheduler this operator will use

    scheduler

    the Scheduler to notify Observers on

    delayError

    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

    bufferSize

    the size of the buffer

    returns

    the source Observable modified so that its Observers are notified on the specified Scheduler

    Definition Classes
    Observable
    See also

    RxJava Threading Examples

    ReactiveX operators documentation: ObserveOn

  118. def observeOn(scheduler: Scheduler, bufferSize: Int): Observable[T]

    Permalink

    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.

    Scheduler:

    you specify which Scheduler this operator will use

    scheduler

    the Scheduler to notify Observers on

    bufferSize

    the size of the buffer.

    returns

    the source Observable modified so that its Observers are notified on the specified Scheduler

    Definition Classes
    Observable
    See also

    RxJava Threading Examples

    ReactiveX operators documentation: ObserveOn

  119. def observeOn(scheduler: Scheduler, delayError: Boolean): Observable[T]

    Permalink

    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.

    Scheduler:

    you specify which Scheduler this operator will use

    scheduler

    the Scheduler to notify Observers on

    delayError

    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

    returns

    the source Observable that its Observers are notified on the specified Scheduler

    Definition Classes
    Observable
    See also

    RxJava Threading Examples

    ReactiveX operators documentation: ObserveOn

  120. def observeOn(scheduler: Scheduler): Observable[T]

    Permalink

    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.

    scheduler

    the rx.lang.scala.Scheduler to notify rx.lang.scala.Observers on

    returns

    the source Observable modified so that its rx.lang.scala.Observers are notified on the specified rx.lang.scala.Scheduler

    Definition Classes
    Observable
  121. def onBackpressureBuffer(capacity: Long, onOverflow: ⇒ Unit): Observable[T]

    Permalink

    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.

    Scheduler:

    This method does not operate by default on a particular Scheduler.

    capacity

    capacity of the internal buffer.

    onOverflow

    an action to run when the buffer's capacity is exceeded. This is a by-name parameter.

    returns

    the source Observable modified to buffer items up to the given capacity

    Definition Classes
    Observable
    Annotations
    @Beta()
    Since

    (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)

    See also

    ReactiveX operators documentation: backpressure operators

  122. def onBackpressureBuffer(capacity: Long): Observable[T]

    Permalink

    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.

    Scheduler:

    This method does not operate by default on a particular Scheduler.

    capacity

    capacity of the internal buffer.

    returns

    an Observable that will buffer items up to the given capacity

    Definition Classes
    Observable
    Annotations
    @Beta()
    Since

    (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)

    See also

    ReactiveX operators documentation: backpressure operators

  123. def onBackpressureBuffer: Observable[T]

    Permalink

    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.

    Scheduler:

    onBackpressureBuffer does not operate by default on a particular Scheduler.

    returns

    the source Observable modified to buffer items to the extent system resources allow

    Definition Classes
    Observable
    See also

    RxJava wiki: Backpressure

  124. def onBackpressureDrop(onDrop: (T) ⇒ Unit): Observable[T]

    Permalink

    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.

    Scheduler:

    This method does not operate by default on a particular Scheduler.

    onDrop

    the action to invoke for each item dropped. onDrop action should be fast and should never block.

    returns

    an new Observable that will drop onNext notifications on overflow

    Definition Classes
    Observable
    Annotations
    @Experimental()
    Since

    (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)

    See also

    ReactiveX operators documentation: backpressure operators

  125. def onBackpressureDrop: Observable[T]

    Permalink

    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.

    Scheduler:

    onBackpressureDrop does not operate by default on a particular Scheduler.

    returns

    the source Observable modified to drop onNext notifications on overflow

    Definition Classes
    Observable
    See also

    RxJava wiki: Backpressure

  126. def onBackpressureLatest: Observable[T]

    Permalink

    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.

    returns

    the source Observable modified so that it emits the most recently-received item upon request

    Definition Classes
    Observable
    Annotations
    @Experimental()
    Since

    (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)

  127. def onCompleted(): Unit

    Permalink

    Notifies the Observer that the rx.lang.scala.Observable has finished sending push-based notifications.

    Notifies the Observer that the rx.lang.scala.Observable has finished sending push-based notifications.

    The rx.lang.scala.Observable will not call this method if it calls onError.

    Definition Classes
    SubjectObserver
  128. def onError(error: Throwable): Unit

    Permalink

    Notifies the Observer that the rx.lang.scala.Observable has experienced an error condition.

    Notifies the Observer that the rx.lang.scala.Observable has experienced an error condition.

    If the rx.lang.scala.Observable calls this method, it will not thereafter call onNext or onCompleted.

    Definition Classes
    SubjectObserver
  129. def onErrorResumeNext[U >: T](resumeFunction: (Throwable) ⇒ Observable[U]): Observable[U]

    Permalink

    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.

    resumeFunction

    a function that returns an Observable that will take over if the source Observable encounters an error

    returns

    the original Observable, with appropriately modified behavior

    Definition Classes
    Observable
  130. def onErrorReturn[U >: T](resumeFunction: (Throwable) ⇒ U): Observable[U]

    Permalink

    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.

    resumeFunction

    a function that returns an item that the new Observable will emit if the source Observable encounters an error

    returns

    the original Observable with appropriately modified behavior

    Definition Classes
    Observable
  131. def onExceptionResumeNext[U >: T](resumeSequence: Observable[U]): Observable[U]

    Permalink

    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.

    resumeSequence

    a function that returns an Observable that will take over if the source Observable encounters an error

    returns

    the original Observable, with appropriately modified behavior

    Definition Classes
    Observable
  132. def onNext(value: T): Unit

    Permalink

    Provides the Observer with new data.

    Provides the Observer with new data.

    The rx.lang.scala.Observable calls this closure 0 or more times.

    The rx.lang.scala.Observable will not call this method again after it calls either onCompleted or onError.

    Definition Classes
    SubjectObserver
  133. def onTerminateDetach: Observable[T]

    Permalink

    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.

    Backpressure:

    Fully supports backpressure.

    Scheduler:

    This method does not operate by default on a particular Scheduler.

    returns

    an Observable which out references to the upstream Producer and downstream Subscriber if the sequence is terminated or downstream unsubscribes

    Definition Classes
    Observable
    Annotations
    @Experimental()
  134. def orElse[U >: T](default: ⇒ U): Observable[U]

    Permalink

    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.

    default

    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.

    returns

    an Observable that emits either the specified default item if the source Observable emits no items, or the items emitted by the source Observable

    Definition Classes
    Observable
  135. def product: Observable[T]

    Permalink

    [use case] Returns an Observable that multiplies up the elements of this Observable.

    [use case]

    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.

    returns

    an Observable emitting the product of all the elements of the source Observable as its single item.

    Definition Classes
    Observable
    Full Signature

    def product[U >: T](implicit num: Numeric[U]): Observable[U]

  136. def publish[R](selector: (Observable[T]) ⇒ Observable[R]): Observable[R]

    Permalink

    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.

    selector

    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.

    returns

    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

    Definition Classes
    Observable
  137. def publish: ConnectableObservable[T]

    Permalink

    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.

    returns

    an rx.lang.scala.observables.ConnectableObservable.

    Definition Classes
    Observable
  138. def rebatchRequests(n: Int): Observable[T]

    Permalink

    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.

    Backpressure:

    The operator expects backpressure from upstream and honors backpressure from downstream. ===Scheduler:=== This method does not operate by default on a particular [[Scheduler]].

    n

    the initial request amount, further request will happen after 75% of this value

    returns

    the Observable that rebatches request amounts from downstream

    Definition Classes
    Observable
    Annotations
    @Experimental()
  139. def reduce[U >: T](accumulator: (U, U) ⇒ U): Observable[U]

    Permalink

    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.

    accumulator

    An accumulator function to be invoked on each item emitted by the source Observable, whose result will be used in the next accumulator call

    returns

    an Observable that emits a single item that is the result of accumulating the output from the source Observable

    Definition Classes
    Observable
  140. def repeat(count: Long, scheduler: Scheduler): Observable[T]

    Permalink

    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.

    count

    the number of times the source Observable items are repeated, a count of 0 will yield an empty sequence

    scheduler

    the Scheduler to emit the items on

    returns

    an Observable that repeats the sequence of items emitted by the source Observable at most count times on a particular Scheduler

    Definition Classes
    Observable
    See also

    MSDN: Observable.Repeat

    RxJava Wiki: repeat()

  141. def repeat(count: Long): Observable[T]

    Permalink

    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.

    count

    the number of times the source Observable items are repeated, a count of 0 will yield an empty sequence

    returns

    an Observable that repeats the sequence of items emitted by the source Observable at most count times

    Definition Classes
    Observable
    Exceptions thrown

    java.lang.IllegalArgumentException if count is less than zero

    See also

    MSDN: Observable.Repeat

    RxJava Wiki: repeat()

  142. def repeat(scheduler: Scheduler): Observable[T]

    Permalink

    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.

    scheduler

    the Scheduler to emit the items on

    returns

    an Observable that emits the items emitted by the source Observable repeatedly and in sequence

    Definition Classes
    Observable
    See also

    MSDN: Observable.Repeat

    RxJava Wiki: repeat()

  143. def repeat: Observable[T]

    Permalink

    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.

    returns

    an Observable that emits the items emitted by the source Observable repeatedly and in sequence

    Definition Classes
    Observable
    See also

    MSDN: Observable.Repeat

    RxJava Wiki: repeat()

  144. def repeatWhen(notificationHandler: (Observable[Unit]) ⇒ Observable[Any]): Observable[T]

    Permalink

    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.

    notificationHandler

    receives an Observable of a Unit with which a user can complete or error, aborting the repeat.

    returns

    the source Observable modified with repeat logic

    Definition Classes
    Observable
    Example:
    1. 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>

      `repeatWhen` operates by default on the `trampoline` [[Scheduler]].
      </dl>

    Since

    0.20

    See also

    MSDN: Observable.Repeat

    RxJava Wiki: repeatWhen()

  145. def repeatWhen(notificationHandler: (Observable[Unit]) ⇒ Observable[Any], scheduler: Scheduler): Observable[T]

    Permalink

    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>

    you specify which [[Scheduler]] this operator will use
    </dl>

    notificationHandler

    receives an Observable of a Unit with which a user can complete or error, aborting the repeat.

    scheduler

    the Scheduler to emit the items on

    returns

    the source Observable modified with repeat logic

    Definition Classes
    Observable
    Since

    0.20

    See also

    MSDN: Observable.Repeat

    RxJava Wiki: repeatWhen()

  146. def replay(scheduler: Scheduler): ConnectableObservable[T]

    Permalink

    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.

    scheduler

    the Scheduler on which the Observers will observe the emitted items

    returns

    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

    Definition Classes
    Observable
  147. def replay(time: Duration, scheduler: Scheduler): ConnectableObservable[T]

    Permalink

    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.

    time

    the duration of the window in which the replayed items must have been emitted

    scheduler

    the Scheduler that is the time source for the window

    returns

    a ConnectableObservable that shares a single subscription to the source Observable and replays the items that were emitted during the window defined by time

    Definition Classes
    Observable
  148. def replay(time: Duration): ConnectableObservable[T]

    Permalink

    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.

    time

    the duration of the window in which the replayed items must have been emitted

    returns

    a ConnectableObservable that shares a single subscription to the source Observable and replays the items that were emitted during the window defined by time

    Definition Classes
    Observable
  149. def replay(bufferSize: Int, scheduler: Scheduler): ConnectableObservable[T]

    Permalink

    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.

    bufferSize

    the buffer size that limits the number of items that can be replayed

    scheduler

    the scheduler on which the Observers will observe the emitted items

    returns

    a ConnectableObservable that shares a single subscription to the source Observable and replays at most bufferSize items that were emitted by the Observable

    Definition Classes
    Observable
  150. def replay(bufferSize: Int): ConnectableObservable[T]

    Permalink

    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.

    bufferSize

    the buffer size that limits the number of items that can be replayed

    returns

    a ConnectableObservable that shares a single subscription to the source Observable and replays at most bufferSize items emitted by that Observable

    Definition Classes
    Observable
  151. def replay[R](selector: (Observable[T]) ⇒ Observable[R], time: Duration): Observable[R]

    Permalink

    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.

    selector

    a selector function, which can use the multicasted sequence as many times as needed, without causing multiple subscriptions to the Observable

    time

    the duration of the window in which the replayed items must have been emitted

    returns

    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

    Definition Classes
    Observable
  152. def replay(bufferSize: Int, time: Duration, scheduler: Scheduler): ConnectableObservable[T]

    Permalink

    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.

    bufferSize

    the buffer size that limits the number of items that can be replayed

    time

    the duration of the window in which the replayed items must have been emitted

    scheduler

    the scheduler that is used as a time source for the window

    returns

    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

    Definition Classes
    Observable
    Exceptions thrown

    java.lang.IllegalArgumentException if bufferSize is less than zero

  153. def replay(bufferSize: Int, time: Duration): ConnectableObservable[T]

    Permalink

    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.

    bufferSize

    the buffer size that limits the number of items that can be replayed

    time

    the duration of the window in which the replayed items must have been emitted

    returns

    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

    Definition Classes
    Observable
  154. def replay[R](selector: (Observable[T]) ⇒ Observable[R], scheduler: Scheduler): Observable[R]

    Permalink

    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.

    selector

    a selector function, which can use the multicasted sequence as many times as needed, without causing multiple subscriptions to the Observable

    scheduler

    the Scheduler where the replay is observed

    returns

    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

    Definition Classes
    Observable
  155. def replay[R](selector: (Observable[T]) ⇒ Observable[R], time: Duration, scheduler: Scheduler): Observable[R]

    Permalink

    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.

    selector

    a selector function, which can use the multicasted sequence as many times as needed, without causing multiple subscriptions to the Observable

    time

    the duration of the window in which the replayed items must have been emitted

    returns

    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

    Definition Classes
    Observable
  156. def replay[R](selector: (Observable[T]) ⇒ Observable[R], bufferSize: Int, scheduler: Scheduler): Observable[R]

    Permalink

    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.

    selector

    a selector function, which can use the multicasted sequence as many times as needed, without causing multiple subscriptions to the Observable

    bufferSize

    the buffer size that limits the number of items the connectable observable can replay

    scheduler

    the Scheduler on which the replay is observed

    returns

    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

    Definition Classes
    Observable
  157. def replay[R](selector: (Observable[T]) ⇒ Observable[R], bufferSize: Int, time: Duration, scheduler: Scheduler): Observable[R]

    Permalink

    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.

    selector

    a selector function, which can use the multicasted sequence as many times as needed, without causing multiple subscriptions to the Observable

    bufferSize

    the buffer size that limits the number of items the connectable observable can replay

    time

    the duration of the window in which the replayed items must have been emitted

    scheduler

    the Scheduler that is the time source for the window

    returns

    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

    Definition Classes
    Observable
    Exceptions thrown

    java.lang.IllegalArgumentException if bufferSize is less than zero

  158. def replay[R](selector: (Observable[T]) ⇒ Observable[R], bufferSize: Int, time: Duration): Observable[R]

    Permalink

    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.

    selector

    a selector function, which can use the multicasted sequence as many times as needed, without causing multiple subscriptions to the Observable

    bufferSize

    the buffer size that limits the number of items the connectable observable can replay

    time

    the duration of the window in which the replayed items must have been emitted

    returns

    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

    Definition Classes
    Observable
  159. def replay[R](selector: (Observable[T]) ⇒ Observable[R], bufferSize: Int): Observable[R]

    Permalink

    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.

    selector

    the selector function, which can use the multicasted sequence as many times as needed, without causing multiple subscriptions to the Observable

    bufferSize

    the buffer size that limits the number of items the connectable observable can replay

    returns

    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

    Definition Classes
    Observable
  160. def replay[R](selector: (Observable[T]) ⇒ Observable[R]): Observable[R]

    Permalink

    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.

    selector

    the selector function, which can use the multicasted sequence as many times as needed, without causing multiple subscriptions to the Observable

    returns

    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

    Definition Classes
    Observable
  161. def replay: ConnectableObservable[T]

    Permalink

    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.

    returns

    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

    Definition Classes
    Observable
  162. def retry(predicate: (Int, Throwable) ⇒ Boolean): Observable[T]

    Permalink

    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.

    predicate

    the predicate that determines if a resubscription may happen in case of a specific exception and retry count

    returns

    the source Observable modified with retry logic

    Definition Classes
    Observable
  163. def retry: Observable[T]

    Permalink

    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].

    returns

    Observable with retry logic.

    Definition Classes
    Observable
  164. def retry(retryCount: Long): Observable[T]

    Permalink

    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].

    retryCount

    Number of retry attempts before failing.

    returns

    Observable with retry logic.

    Definition Classes
    Observable
  165. def retryWhen(notificationHandler: (Observable[Throwable]) ⇒ Observable[Any], scheduler: Scheduler): Observable[T]

    Permalink

    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>

    you specify which [[Scheduler]] this operator will use
    </dl>

    notificationHandler

    receives an Observable of a Throwable with which a user can complete or error, aborting the retry

    scheduler

    the Scheduler on which to subscribe to the source Observable

    returns

    the source Observable modified with retry logic

    Definition Classes
    Observable
    Since

    0.20

    See also

    RxScalaDemo.retryWhenDifferentExceptionsExample for a more intricate example

    RxJava Wiki: retryWhen()

  166. def retryWhen(notificationHandler: (Observable[Throwable]) ⇒ Observable[Any]): Observable[T]

    Permalink

    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.

    notificationHandler

    receives an Observable of a Throwable with which a user can complete or error, aborting the retry

    returns

    the source Observable modified with retry logic

    Definition Classes
    Observable
    Example:
    1. 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>

      `retryWhen` operates by default on the `trampoline` [[Scheduler]].
      </dl>

    Since

    0.20

    See also

    RxScalaDemo.retryWhenDifferentExceptionsExample for a more intricate example

    RxJava Wiki: retryWhen()

  167. def sample(sampler: Observable[Any]): Observable[T]

    Permalink

    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.

    sampler

    the Observable to use for sampling the source Observable

    returns

    an Observable that emits the results of sampling the items emitted by this Observable whenever the sampler Observable emits an item or completes

    Definition Classes
    Observable
  168. def sample(duration: Duration, scheduler: Scheduler): Observable[T]

    Permalink

    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.

    duration

    the sampling rate

    scheduler

    the rx.lang.scala.Scheduler to use when sampling

    returns

    an Observable that emits the results of sampling the items emitted by the source Observable at the specified time interval

    Definition Classes
    Observable
  169. def sample(duration: Duration): Observable[T]

    Permalink

    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.

    duration

    the sampling rate

    returns

    an Observable that emits the results of sampling the items emitted by the source Observable at the specified time interval

    Definition Classes
    Observable
  170. def scan[U >: T](accumulator: (U, U) ⇒ U): Observable[U]

    Permalink

    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.

    accumulator

    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.

    returns

    an Observable that emits the results of each call to the accumulator function

    Definition Classes
    Observable
  171. def scan[R](initialValue: R)(accumulator: (R, T) ⇒ R): Observable[R]

    Permalink

    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.

    initialValue

    the initial (seed) accumulator value

    accumulator

    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.

    returns

    an Observable that emits the results of each call to the accumulator function

    Definition Classes
    Observable
  172. def sequenceEqual[U >: T](that: Observable[U]): Observable[Boolean]

    Permalink

    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.

    that

    the Observable to compare

    returns

    an Observable that emits a Boolean value that indicates whether the two sequences are the same

    Definition Classes
    Observable
  173. def sequenceEqualWith[U >: T](that: Observable[U])(equality: (U, U) ⇒ Boolean): Observable[Boolean]

    Permalink

    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.

    that

    the Observable to compare

    equality

    a function used to compare items emitted by each Observable

    returns

    an Observable that emits a Boolean value that indicates whether the two sequences are the same based on the equality function.

    Definition Classes
    Observable
  174. def serialize: Observable[T]

    Permalink

    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.

    returns

    an Observable that is a chronologically well-behaved version of the source Observable, and that synchronously notifies its rx.lang.scala.Observers

    Definition Classes
    Observable
  175. def share: Observable[T]

    Permalink

    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()

    returns

    a Observable that upon connection causes the source Observable to emit items to its Subscribers

    Definition Classes
    Observable
    Since

    0.19

  176. def single: Observable[T]

    Permalink

    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.

    returns

    an Observable that emits the single item emitted by the source Observable

    Definition Classes
    Observable
    Exceptions thrown

    java.lang.IllegalArgumentException if the source emits more than one item

    java.util.NoSuchElementException if the source emits no items

    See also

    "MSDN: Observable.singleAsync()"

    RxJava Wiki: single()

  177. def singleOption: Observable[Option[T]]

    Permalink

    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.

    returns

    an Observable that emits an Option with the single item emitted by the source Observable, or None if the source Observable is empty

    Definition Classes
    Observable
    Exceptions thrown

    java.lang.IllegalArgumentException if the source Observable emits more than one item

  178. def singleOrElse[U >: T](default: ⇒ U): Observable[U]

    Permalink

    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.

    default

    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.

    returns

    an Observable that emits the single item emitted by the source Observable, or a default item if the source Observable is empty

    Definition Classes
    Observable
    Exceptions thrown

    java.lang.IllegalArgumentException if the source Observable emits more than one item

  179. def size: Observable[Int]

    Permalink

    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.

    returns

    an Observable emitting the number of counted elements of the source Observable as its single item.

    Definition Classes
    Observable
  180. def sliding(timespan: Duration, timeshift: Duration, count: Int, scheduler: Scheduler): Observable[Observable[T]]

    Permalink

    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.

    Backpressure Support:

    This operator does not support backpressure as it uses time to control data flow.

    Scheduler:

    you specify which Scheduler this operator will use

    timespan

    the period of time each window collects items before it should be emitted

    timeshift

    the period of time after which a new window will be created

    count

    the maximum size of each window before it should be emitted

    scheduler

    the Scheduler to use when determining the end and start of a window

    returns

    an Observable that emits new windows periodically as a fixed timespan elapses

    Definition Classes
    Observable
    See also

    MSDN: Observable.Window

    RxJava wiki: window

  181. def sliding(timespan: Duration, timeshift: Duration, scheduler: Scheduler): Observable[Observable[T]]

    Permalink

    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.

    timespan

    The period of time each window is collecting values before it should be emitted.

    timeshift

    The period of time after which a new window will be created.

    scheduler

    The rx.lang.scala.Scheduler to use when determining the end and start of a window.

    returns

    An rx.lang.scala.Observable which produces new windows periodically, and these are emitted after a fixed timespan has elapsed.

    Definition Classes
    Observable
  182. def sliding(timespan: Duration, timeshift: Duration): Observable[Observable[T]]

    Permalink

    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.

    timespan

    The period of time each window is collecting values before it should be emitted.

    timeshift

    The period of time after which a new window will be created.

    returns

    An rx.lang.scala.Observable which produces new windows periodically, and these are emitted after a fixed timespan has elapsed.

    Definition Classes
    Observable
  183. def sliding(count: Int, skip: Int): Observable[Observable[T]]

    Permalink

    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.

    count

    The maximum size of each window before it should be emitted.

    skip

    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).

    returns

    An rx.lang.scala.Observable which produces windows every skip values containing at most count produced values.

    Definition Classes
    Observable
  184. def sliding[Opening](openings: Observable[Opening])(closings: (Opening) ⇒ Observable[Any]): Observable[Observable[T]]

    Permalink

    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.

    openings

    The rx.lang.scala.Observable which when it produces an object, will cause another window to be created.

    closings

    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.

    returns

    An rx.lang.scala.Observable which produces windows which are created and emitted when the specified rx.lang.scala.Observables publish certain objects.

    Definition Classes
    Observable
  185. def slidingBuffer(timespan: Duration, timeshift: Duration, scheduler: Scheduler): Observable[Seq[T]]

    Permalink

    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.

    timespan

    The period of time each buffer is collecting values before it should be emitted.

    timeshift

    The period of time after which a new buffer will be created.

    scheduler

    The rx.lang.scala.Scheduler to use when determining the end and start of a buffer.

    returns

    An rx.lang.scala.Observable which produces new buffers periodically, and these are emitted after a fixed timespan has elapsed.

    Definition Classes
    Observable
  186. def slidingBuffer(timespan: Duration, timeshift: Duration): Observable[Seq[T]]

    Permalink

    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.

    timespan

    The period of time each buffer is collecting values before it should be emitted.

    timeshift

    The period of time after which a new buffer will be created.

    returns

    An rx.lang.scala.Observable which produces new buffers periodically, and these are emitted after a fixed timespan has elapsed.

    Definition Classes
    Observable
  187. def slidingBuffer(count: Int, skip: Int): Observable[Seq[T]]

    Permalink

    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.

    count

    The maximum size of each buffer before it should be emitted.

    skip

    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).

    returns

    An rx.lang.scala.Observable which produces buffers every skip values containing at most count produced values.

    Definition Classes
    Observable
  188. def slidingBuffer[Opening](openings: Observable[Opening])(closings: (Opening) ⇒ Observable[Any]): Observable[Seq[T]]

    Permalink

    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.

    openings

    The rx.lang.scala.Observable which, when it produces an object, will cause another buffer to be created.

    closings

    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.

    returns

    An rx.lang.scala.Observable which produces buffers which are created and emitted when the specified rx.lang.scala.Observables publish certain objects.

    Definition Classes
    Observable
  189. def subscribe(onNext: (T) ⇒ Unit, onError: (Throwable) ⇒ Unit, onCompleted: () ⇒ Unit): Subscription

    Permalink

    Call this method to receive items and notifications from this observable.

    Call this method to receive items and notifications from this observable.

    Scheduler:

    This method does not operate by default on a particular Scheduler.

    onNext

    this function will be called whenever the Observable emits an item

    onError

    this function will be called if an error occurs

    onCompleted

    this function will be called when this Observable has finished emitting items

    returns

    a rx.lang.scala.Subscription reference whose unsubscribe method can be called to stop receiving items before the Observable has finished sending them

    Definition Classes
    Observable
    See also

    ReactiveX operators documentation: Subscribe

  190. def subscribe(onNext: (T) ⇒ Unit, onError: (Throwable) ⇒ Unit): Subscription

    Permalink

    Call this method to receive items and notifications from this observable.

    Call this method to receive items and notifications from this observable.

    Scheduler:

    This method does not operate by default on a particular Scheduler.

    onNext

    this function will be called whenever the Observable emits an item

    onError

    this function will be called if an error occurs

    returns

    a rx.lang.scala.Subscription reference whose unsubscribe method can be called to stop receiving items before the Observable has finished sending them

    Definition Classes
    Observable
    See also

    ReactiveX operators documentation: Subscribe

  191. def subscribe(onNext: (T) ⇒ Unit): Subscription

    Permalink

    Call this method to receive items from this observable.

    Call this method to receive items from this observable.

    Scheduler:

    This method does not operate by default on a particular Scheduler.

    onNext

    this function will be called whenever the Observable emits an item

    returns

    a rx.lang.scala.Subscription reference whose unsubscribe method can be called to stop receiving items before the Observable has finished sending them

    Definition Classes
    Observable
    Exceptions thrown

    rx.exceptions.OnErrorNotImplementedException if the Observable tries to call onError

    See also

    ReactiveX operators documentation: Subscribe

  192. def subscribe(subscriber: Subscriber[T]): Subscription

    Permalink

    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.

    Scheduler:

    This method does not operate by default on a particular Scheduler.

    subscriber

    the Subscriber

    returns

    a rx.lang.scala.Subscription reference whose unsubscribe method can be called to stop receiving items before the Observable has finished sending them

    Definition Classes
    Observable
    See also

    ReactiveX operators documentation: Subscribe

  193. def subscribe(observer: Observer[T]): Subscription

    Permalink

    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.

    Scheduler:

    This method does not operate by default on a particular Scheduler.

    observer

    the observer

    returns

    a rx.lang.scala.Subscription reference whose unsubscribe method can be called to stop receiving items before the Observable has finished sending them

    Definition Classes
    Observable
    See also

    ReactiveX operators documentation: Subscribe

  194. def subscribe(): Subscription

    Permalink

    Subscribes to an Observable but ignore its emissions and notifications.

    Subscribes to an Observable but ignore its emissions and notifications.

    Scheduler:

    This method does not operate by default on a particular Scheduler.

    returns

    a rx.lang.scala.Subscription reference whose unsubscribe method can be called to stop receiving items before the Observable has finished sending them

    Definition Classes
    Observable
    Exceptions thrown

    rx.exceptions.OnErrorNotImplementedException if the Observable tries to call onError

    See also

    ReactiveX operators documentation: Subscribe

  195. def subscribeOn(scheduler: Scheduler): Observable[T]

    Permalink

    Asynchronously subscribes and unsubscribes Observers on the specified rx.lang.scala.Scheduler.

    Asynchronously subscribes and unsubscribes Observers on the specified rx.lang.scala.Scheduler.

    scheduler

    the rx.lang.scala.Scheduler to perform subscription and unsubscription actions on

    returns

    the source Observable modified so that its subscriptions and unsubscriptions happen on the specified rx.lang.scala.Scheduler

    Definition Classes
    Observable
  196. def sum: Observable[T]

    Permalink

    [use case] Returns an Observable that sums up the elements of this Observable.

    [use case]

    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.

    returns

    an Observable emitting the sum of all the elements of the source Observable as its single item.

    Definition Classes
    Observable
    Full Signature

    def sum[U >: T](implicit num: Numeric[U]): Observable[U]

  197. def switch[U]: Observable[U]

    Permalink

    [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.

    [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.

    This operation is only available if this is of type Observable[Observable[U]] for some U, otherwise you'll get a compilation error.

    returns

    an Observable that emits only the items emitted by the most recently published Observable

    Definition Classes
    Observable
    Full Signature

    def switch[U](implicit evidence: <:<[Observable[T], Observable[Observable[U]]]): Observable[U]

  198. def switchIfEmpty[U >: T](alternate: Observable[U]): Observable[U]

    Permalink

    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.

    Scheduler:

    This method does not operate by default on a particular Scheduler.

    alternate

    the alternate Observable to subscribe to if the source does not emit any items

    returns

    an Observable that emits the items emitted by the source Observable or the items of an

    Definition Classes
    Observable
    Annotations
    @Experimental()
    Since

    (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number) alternate Observable if the source Observable is empty.

  199. def switchMap[R](f: (T) ⇒ Observable[R]): Observable[R]

    Permalink

    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.

    f

    a function that, when applied to an item emitted by the source Observable, returns an Observable

    returns

    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

    Definition Classes
    Observable
  200. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  201. def tail: Observable[T]

    Permalink

    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.

    returns

    an Observable that emits all items except the first one, or raises an UnsupportedOperationException if the source Observable is empty.

    Definition Classes
    Observable
  202. def take(time: Duration, scheduler: Scheduler): Unit

    Permalink

    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

    time

    the length of the time window

    scheduler

    the Scheduler used for time source

    returns

    an Observable that emits those items emitted by the source Observable before the time runs out, according to the specified Scheduler

    Definition Classes
    Observable
  203. def take(time: Duration): Observable[T]

    Permalink

    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.

    time

    the length of the time window

    returns

    an Observable that emits those items emitted by the source Observable before the time runs out

    Definition Classes
    Observable
  204. def take(n: Int): Observable[T]

    Permalink

    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.

    n

    the number of items to take

    returns

    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

    Definition Classes
    Observable
  205. def takeRight(count: Int, time: Duration, scheduler: Scheduler): Observable[T]

    Permalink

    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.

    count

    the maximum number of items to emit

    time

    the length of the time window

    scheduler

    the Scheduler that provides the timestamps for the observed items

    returns

    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

    Definition Classes
    Observable
    Exceptions thrown

    java.lang.IllegalArgumentException if count is less than zero

  206. def takeRight(count: Int, time: Duration): Observable[T]

    Permalink

    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.

    count

    the maximum number of items to emit

    time

    the length of the time window

    returns

    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

    Definition Classes
    Observable
    Exceptions thrown

    java.lang.IllegalArgumentException if count is less than zero

  207. def takeRight(time: Duration, scheduler: Scheduler): Observable[T]

    Permalink

    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.

    time

    the length of the time window

    scheduler

    the Scheduler that provides the timestamps for the Observed items

    returns

    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

    Definition Classes
    Observable
  208. def takeRight(time: Duration): Observable[T]

    Permalink

    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.

    time

    the length of the time window

    returns

    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

    Definition Classes
    Observable
  209. def takeRight(count: Int): Observable[T]

    Permalink

    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.

    count

    the number of items to emit from the end of the sequence emitted by the source Observable

    returns

    an Observable that emits only the last count items emitted by the source Observable

    Definition Classes
    Observable
  210. def takeUntil(that: Observable[Any]): Observable[T]

    Permalink

    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.

    that

    the Observable whose first emitted item will cause takeUntil to stop emitting items from the source Observable

    returns

    an Observable that emits the items of the source Observable until such time as other emits its first item

    Definition Classes
    Observable
  211. def takeUntil(stopPredicate: (T) ⇒ Boolean): Observable[T]

    Permalink

    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.

    Scheduler:

    This method does not operate by default on a particular Scheduler.

    stopPredicate

    a function that evaluates an item emitted by the source Observable and returns a Boolean

    returns

    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.

    Definition Classes
    Observable
    Annotations
    @Experimental()
    Since

    (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)

    See also

    Observable.takeWhile

    ReactiveX operators documentation: TakeUntil

  212. def takeWhile(predicate: (T) ⇒ Boolean): Observable[T]

    Permalink

    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.

    predicate

    a function that evaluates an item emitted by the source Observable and returns a Boolean

    returns

    an Observable that emits the items from the source Observable so long as each item satisfies the condition defined by predicate

    Definition Classes
    Observable
  213. def throttleFirst(skipDuration: Duration): Observable[T]

    Permalink

    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.

    skipDuration

    Time to wait before sending another value after emitting last value.

    returns

    Observable which performs the throttle operation.

    Definition Classes
    Observable
  214. def throttleFirst(skipDuration: Duration, scheduler: Scheduler): Observable[T]

    Permalink

    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.

    skipDuration

    Time to wait before sending another value after emitting last value.

    scheduler

    The rx.lang.scala.Scheduler to use internally to manage the timers which handle timeout for each event.

    returns

    Observable which performs the throttle operation.

    Definition Classes
    Observable
  215. def throttleLast(intervalDuration: Duration, scheduler: Scheduler): Observable[T]

    Permalink

    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.

    intervalDuration

    Duration of windows within with the last value will be chosen.

    returns

    Observable which performs the throttle operation.

    Definition Classes
    Observable
  216. def throttleLast(intervalDuration: Duration): Observable[T]

    Permalink

    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.

    intervalDuration

    Duration of windows within with the last value will be chosen.

    returns

    Observable which performs the throttle operation.

    Definition Classes
    Observable
  217. def throttleWithTimeout(timeout: Duration, scheduler: Scheduler): Observable[T]

    Permalink

    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.

    timeout

    The time each value has to be 'the most recent' of the rx.lang.scala.Observable to ensure that it's not dropped.

    scheduler

    The rx.lang.scala.Scheduler to use internally to manage the timers which handle timeout for each event.

    returns

    Observable which performs the throttle operation.

    Definition Classes
    Observable
    See also

    Observable.debounce

  218. def throttleWithTimeout(timeout: Duration): Observable[T]

    Permalink

    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:

    timeout

    The time each value has to be 'the most recent' of the rx.lang.scala.Observable to ensure that it's not dropped.

    returns

    An rx.lang.scala.Observable which filters out values which are too quickly followed up with newer values.

    Definition Classes
    Observable
    See also

    Observable.debounce

  219. def timeInterval(scheduler: Scheduler): Observable[(Duration, T)]

    Permalink

    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.

    scheduler

    the Scheduler used to compute time intervals

    returns

    an Observable that emits time interval information items

    Definition Classes
    Observable
  220. def timeInterval: Observable[(Duration, T)]

    Permalink

    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.

    returns

    an Observable that emits time interval information items

    Definition Classes
    Observable
  221. def timeout[U >: T](firstTimeoutSelector: () ⇒ Observable[Any], timeoutSelector: (T) ⇒ Observable[Any], other: Observable[U]): Observable[U]

    Permalink

    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.

    firstTimeoutSelector

    a function that returns an Observable which determines the timeout window for the first source item

    timeoutSelector

    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

    other

    the fallback Observable to switch to if the source Observable times out

    returns

    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

    Definition Classes
    Observable
  222. def timeout(firstTimeoutSelector: () ⇒ Observable[Any], timeoutSelector: (T) ⇒ Observable[Any]): Observable[T]

    Permalink

    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.

    firstTimeoutSelector

    a function that returns an Observable that determines the timeout window for the first source item

    timeoutSelector

    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

    returns

    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

    Definition Classes
    Observable
  223. def timeout[U >: T](timeoutSelector: (T) ⇒ Observable[Any], other: Observable[U]): Observable[U]

    Permalink

    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.

    timeoutSelector

    a function that returns an observable for each item emitted by the source Observable and that determines the timeout window for the subsequent item

    other

    the fallback Observable to switch to if the source Observable times out

    returns

    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

    Definition Classes
    Observable
  224. def timeout(timeoutSelector: (T) ⇒ Observable[Any]): Observable[T]

    Permalink

    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.

    timeoutSelector

    a function that returns an observable for each item emitted by the source Observable and that determines the timeout window for the subsequent item

    returns

    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

    Definition Classes
    Observable
  225. def timeout[U >: T](timeout: Duration, other: Observable[U], scheduler: Scheduler): Observable[U]

    Permalink

    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.

    timeout

    maximum duration between items before a timeout occurs

    other

    Observable to use as the fallback in case of a timeout

    scheduler

    Scheduler to run the timeout timers on

    returns

    the source Observable modified so that it will switch to the fallback Observable in case of a timeout

    Definition Classes
    Observable
  226. def timeout(timeout: Duration, scheduler: Scheduler): Observable[T]

    Permalink

    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.

    timeout

    maximum duration between items before a timeout occurs

    scheduler

    Scheduler to run the timeout timers on

    returns

    the source Observable modified to notify observers of a TimeoutException in case of a timeout

    Definition Classes
    Observable
  227. def timeout[U >: T](timeout: Duration, other: Observable[U]): Observable[U]

    Permalink

    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.

    timeout

    maximum duration between items before a timeout occurs

    other

    fallback Observable to use in case of a timeout

    returns

    the source Observable modified to switch to the fallback Observable in case of a timeout

    Definition Classes
    Observable
  228. def timeout(timeout: Duration): Observable[T]

    Permalink

    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.

    timeout

    maximum duration between items before a timeout occurs

    returns

    the source Observable modified to notify observers of a TimeoutException in case of a timeout

    Definition Classes
    Observable
  229. def timestamp(scheduler: Scheduler): Observable[(Long, T)]

    Permalink

    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.

    scheduler

    rx.lang.scala.Scheduler to use as a time source.

    returns

    an Observable that emits timestamped items from the source Observable with timestamps provided by the given Scheduler

    Definition Classes
    Observable
  230. def timestamp: Observable[(Long, T)]

    Permalink

    Wraps each item emitted by a source Observable in a timestamped tuple.

    Wraps each item emitted by a source Observable in a timestamped tuple.

    returns

    an Observable that emits timestamped items from the source Observable

    Definition Classes
    Observable
  231. def to[Col[_]](implicit cbf: CanBuildFrom[Nothing, T, Col[T]]): Observable[Col[T]]

    Permalink

    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.

    Col

    the collection type to build.

    returns

    an Observable that emits a single item, a collection containing all of the items emitted by the source Observable.

    Definition Classes
    Observable
  232. def to[M[_, _], K, V](keySelector: (T) ⇒ K, valueSelector: (T) ⇒ V)(implicit cbf: CanBuildFrom[Nothing, (K, V), M[K, V]]): Observable[M[K, V]]

    Permalink

    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.

    keySelector

    the function that extracts the key from a source item to be used in the Map

    valueSelector

    the function that extracts the value from a source item to be used in the Map

    cbf

    CanBuildFrom to build the Map

    returns

    an Observable that emits a single item: a Map containing the mapped items from the source Observable

    Definition Classes
    Observable
  233. def toArray[U >: T](implicit arg0: ClassTag[U]): Observable[Array[U]]

    Permalink

    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.

    returns

    an Observable that emits a single item, an Array containing all of the items emitted by the source Observable.

    Definition Classes
    Observable
  234. def toBlocking: BlockingObservable[T]

    Permalink

    Converts an Observable into a BlockingObservable (an Observable with blocking operators).

    Converts an Observable into a BlockingObservable (an Observable with blocking operators).

    returns

    a BlockingObservable version of this Observable

    Definition Classes
    Observable
    Since

    0.19

    See also

    Blocking Observable Operators

  235. def toBuffer[U >: T]: Observable[Buffer[U]]

    Permalink

    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.

    returns

    an Observable that emits a single item, a Buffer containing all of the items emitted by the source Observable.

    Definition Classes
    Observable
  236. def toIndexedSeq: Observable[IndexedSeq[T]]

    Permalink

    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.

    returns

    an Observable that emits a single item, an IndexedSeq containing all of the items emitted by the source Observable.

    Definition Classes
    Observable
  237. def toIterable: Observable[Iterable[T]]

    Permalink

    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.

    returns

    an Observable that emits a single item, an Iterable containing all of the items emitted by the source Observable.

    Definition Classes
    Observable
  238. def toIterator: Observable[Iterator[T]]

    Permalink

    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.

    returns

    an Observable that emits a single item, an Iterator containing all of the items emitted by the source Observable.

    Definition Classes
    Observable
  239. def toList: Observable[List[T]]

    Permalink

    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.

    returns

    an Observable that emits a single item, a List containing all of the items emitted by the source Observable.

    Definition Classes
    Observable
  240. def toMap[K, V](keySelector: (T) ⇒ K, valueSelector: (T) ⇒ V): Observable[Map[K, V]]

    Permalink

    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.

    keySelector

    the function that extracts the key from a source item to be used in the Map

    valueSelector

    the function that extracts the value from a source item to be used in the Map

    returns

    an Observable that emits a single item: an Map containing the mapped items from the source Observable

    Definition Classes
    Observable
  241. def toMap[K](keySelector: (T) ⇒ K): Observable[Map[K, T]]

    Permalink

    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.

    keySelector

    the function that extracts the key from a source item to be used in the Map

    returns

    an Observable that emits a single item: an Map containing the mapped items from the source Observable

    Definition Classes
    Observable
  242. def toMap[K, V](implicit ev: <:<[Observable[T], Observable[(K, V)]]): Observable[Map[K, V]]

    Permalink

    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.

    returns

    an Observable that emits a single item: an Map containing all pairs from the source Observable

    Definition Classes
    Observable
  243. def toMultiMap[K, V, M <: MultiMap[K, V]](keySelector: (T) ⇒ K, valueSelector: (T) ⇒ V, multiMapFactory: ⇒ M): Observable[M]

    Permalink

    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.

    keySelector

    the function that extracts a key from the source items to be used as the key in the mutable.MultiMap

    valueSelector

    the function that extracts a value from the source items to be used as the value in the mutable.MultiMap

    multiMapFactory

    a mutable.MultiMap instance to be used. Note: tis is a by-name parameter.

    returns

    an Observable that emits a single item: a mutable.MultiMap that contains keys and values mapped from the source Observable.

    Definition Classes
    Observable
  244. def toMultiMap[K, V](keySelector: (T) ⇒ K, valueSelector: (T) ⇒ V): Observable[MultiMap[K, V]]

    Permalink

    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.

    keySelector

    the function that extracts a key from the source items to be used as key in the mutable.MultiMap

    valueSelector

    the function that extracts a value from the source items to be used as value in the mutable.MultiMap

    returns

    an Observable that emits a single item: a mutable.MultiMap that contains keys and values mapped from the source Observable

    Definition Classes
    Observable
  245. def toMultiMap[K, V >: T](keySelector: (T) ⇒ K): Observable[MultiMap[K, V]]

    Permalink

    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.

    keySelector

    the function that extracts the key from the source items to be used as key in the mutable.MultiMap

    returns

    an Observable that emits a single item: a mutable.MultiMap that contains items emitted by the source Observable keyed by a specified keySelector function.

    Definition Classes
    Observable
  246. def toSeq: Observable[Seq[T]]

    Permalink

    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.

    returns

    an Observable that emits a single item: a List containing all of the items emitted by the source Observable.

    Definition Classes
    Observable
  247. def toSerialized: SerializedSubject[T]

    Permalink

    Wraps a Subject so that it is safe to call its various on methods from different threads.

    Wraps a Subject so that it is safe to call its various on methods from different threads.

    When you use an ordinary Subject as a Subscriber, you must take care not to call its Subscriber.onNext method (or its other on methods) from multiple threads, as this could lead to non-serialized calls, which violates the Observable contract and creates an ambiguity in the resulting Subject.

    To protect a Subject from this danger, you can convert it into a SerializedSubject with code like the following:

    mySafeSubject = myUnsafeSubject.toSerialized
    returns

    SerializedSubject wrapping the current Subject

    Definition Classes
    Subject
  248. def toSet[U >: T]: Observable[Set[U]]

    Permalink

    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.

    returns

    an Observable that emits a single item, a Set containing all of the items emitted by the source Observable.

    Definition Classes
    Observable
  249. def toStream: Observable[Stream[T]]

    Permalink

    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.

    returns

    an Observable that emits a single item, a Stream containing all of the items emitted by the source Observable.

    Definition Classes
    Observable
  250. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  251. def toTraversable: Observable[Traversable[T]]

    Permalink

    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.

    returns

    an Observable that emits a single item, a Traversable containing all of the items emitted by the source Observable.

    Definition Classes
    Observable
  252. def toVector: Observable[Vector[T]]

    Permalink

    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.

    returns

    an Observable that emits a single item, a Vector containing all of the items emitted by the source Observable.

    Definition Classes
    Observable
  253. def tumbling(timespan: Duration, count: Int, scheduler: Scheduler): Observable[Observable[T]]

    Permalink

    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.

    timespan

    The period of time each window is collecting values before it should be emitted, and replaced with a new window.

    count

    The maximum size of each window before it should be emitted.

    scheduler

    The rx.lang.scala.Scheduler to use when determining the end and start of a window.

    returns

    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).

    Definition Classes
    Observable
  254. def tumbling(timespan: Duration, count: Int): Observable[Observable[T]]

    Permalink

    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.

    timespan

    The period of time each window is collecting values before it should be emitted, and replaced with a new window.

    count

    The maximum size of each window before it should be emitted.

    returns

    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).

    Definition Classes
    Observable
  255. def tumbling(timespan: Duration, scheduler: Scheduler): Observable[Observable[T]]

    Permalink

    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.

    timespan

    The period of time each window is collecting values before it should be emitted, and replaced with a new window.

    scheduler

    The rx.lang.scala.Scheduler to use when determining the end and start of a window.

    returns

    An rx.lang.scala.Observable which produces connected non-overlapping windows with a fixed duration.

    Definition Classes
    Observable
  256. def tumbling(timespan: Duration): Observable[Observable[T]]

    Permalink

    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.

    timespan

    The period of time each window is collecting values before it should be emitted, and replaced with a new window.

    returns

    An rx.lang.scala.Observable which produces connected non-overlapping windows with a fixed duration.

    Definition Classes
    Observable
  257. def tumbling(count: Int): Observable[Observable[T]]

    Permalink

    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.

    count

    The maximum size of each window before it should be emitted.

    returns

    An rx.lang.scala.Observable which produces connected non-overlapping windows containing at most count produced values.

    Definition Classes
    Observable
  258. def tumbling(boundary: ⇒ Observable[Any]): Observable[Observable[T]]

    Permalink

    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.

    boundary

    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.

    returns

    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.

    Definition Classes
    Observable
  259. def tumblingBuffer(boundary: Observable[Any], initialCapacity: Int): Observable[Seq[T]]

    Permalink

    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.

    boundary

    the boundary Observable

    initialCapacity

    the initial capacity of each buffer chunk

    returns

    an Observable that emits buffered items from the source Observable when the boundary Observable emits an item

    Definition Classes
    Observable
  260. def tumblingBuffer(boundary: ⇒ Observable[Any]): Observable[Seq[T]]

    Permalink

    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.

    boundary

    the boundary Observable. Note: This is a by-name parameter, so it is only evaluated when someone subscribes to the returned Observable.

    returns

    an Observable that emits buffered items from the source Observable when the boundary Observable emits an item

    Definition Classes
    Observable
  261. def tumblingBuffer(timespan: Duration, count: Int, scheduler: Scheduler): Observable[Seq[T]]

    Permalink

    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.

    timespan

    The period of time each buffer is collecting values before it should be emitted, and replaced with a new buffer.

    count

    The maximum size of each buffer before it should be emitted.

    scheduler

    The rx.lang.scala.Scheduler to use when determining the end and start of a buffer.

    returns

    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).

    Definition Classes
    Observable
  262. def tumblingBuffer(timespan: Duration, count: Int): Observable[Seq[T]]

    Permalink

    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.

    timespan

    The period of time each buffer is collecting values before it should be emitted, and replaced with a new buffer.

    count

    The maximum size of each buffer before it should be emitted.

    returns

    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).

    Definition Classes
    Observable
  263. def tumblingBuffer(timespan: Duration, scheduler: Scheduler): Observable[Seq[T]]

    Permalink

    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.

    timespan

    The period of time each buffer is collecting values before it should be emitted, and replaced with a new buffer.

    scheduler

    The rx.lang.scala.Scheduler to use when determining the end and start of a buffer.

    returns

    An rx.lang.scala.Observable which produces connected non-overlapping buffers with a fixed duration.

    Definition Classes
    Observable
  264. def tumblingBuffer(timespan: Duration): Observable[Seq[T]]

    Permalink

    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.

    timespan

    The period of time each buffer is collecting values before it should be emitted, and replaced with a new buffer.

    returns

    An rx.lang.scala.Observable which produces connected non-overlapping buffers with a fixed duration.

    Definition Classes
    Observable
  265. def tumblingBuffer(count: Int): Observable[Seq[T]]

    Permalink

    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.

    count

    The maximum size of each buffer before it should be emitted.

    returns

    An rx.lang.scala.Observable which produces connected non-overlapping buffers containing at most count produced values.

    Definition Classes
    Observable
  266. def unsafeSubscribe(subscriber: Subscriber[T]): Subscription

    Permalink

    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.

    returns

    Subscription which is the Subscriber passed in

    Definition Classes
    Observable
    Since

    0.17

  267. def unsubscribeOn(scheduler: Scheduler): Observable[T]

    Permalink

    Asynchronously unsubscribes on the specified Scheduler.

    Asynchronously unsubscribes on the specified Scheduler.

    scheduler

    the Scheduler to perform subscription and unsubscription actions on

    returns

    the source Observable modified so that its unsubscriptions happen on the specified Scheduler

    Definition Classes
    Observable
    Since

    0.17

  268. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  269. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  270. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  271. def withFilter(p: (T) ⇒ Boolean): WithFilter[T]

    Permalink
    Definition Classes
    Observable
  272. def withLatestFrom[U, R](other: Observable[U])(resultSelector: (T, U) ⇒ R): Observable[R]

    Permalink

    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.

    Scheduler:

    This method does not operate by default on a particular Scheduler.

    other

    the other Observable

    resultSelector

    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

    returns

    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

    Definition Classes
    Observable
    Annotations
    @Experimental()
    Since

    (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)

    See also

    ReactiveX operators documentation: CombineLatest

  273. def zip[U](that: Iterable[U]): Observable[(T, U)]

    Permalink

    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.

    that

    the Iterable sequence

    returns

    an Observable that pairs up values from the source Observable and the other Iterable.

    Definition Classes
    Observable
  274. def zip[U](that: Observable[U]): Observable[(T, U)]

    Permalink

    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.

    that

    the Observable to zip with

    returns

    an Observable that pairs up values from this and that Observables.

    Definition Classes
    Observable
  275. def zipWith[U, R](that: Observable[U])(selector: (T, U) ⇒ R): Observable[R]

    Permalink

    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.

    that

    the Observable to zip with

    returns

    an Observable that pairs up values from this and that Observables.

    Definition Classes
    Observable
  276. def zipWith[U, R](that: Iterable[U])(selector: (T, U) ⇒ R): Observable[R]

    Permalink

    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.

    that

    the Iterable sequence

    selector

    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

    returns

    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

    Definition Classes
    Observable
  277. def zipWithIndex: Observable[(T, Int)]

    Permalink

    Zips this Observable with its indices.

    Zips this Observable with its indices.

    returns

    An Observable emitting pairs consisting of all elements of this Observable paired with their index. Indices start at 0.

    Definition Classes
    Observable

Deprecated Value Members

  1. def cache(capacity: Int): Observable[T]

    Permalink

    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.

    Backpressure Support:

    This operator does not support upstream backpressure as it is purposefully requesting and caching everything emitted.

    Scheduler:

    cache does not operate by default on a particular Scheduler.

    capacity

    hint for number of items to cache (for optimizing underlying data structure)

    returns

    an Observable that, when first subscribed to, caches all of its items and notifications for the benefit of subsequent subscribers

    Definition Classes
    Observable
    Annotations
    @deprecated
    Deprecated

    (Since version 0.26.1) Use Observable.cacheWithInitialCapacity instead

    Since

    0.20

    See also

    RxJava wiki: cache

  2. def finallyDo(action: ⇒ Unit): Observable[T]

    Permalink

    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.

    action

    an function to be invoked when the source Observable finishes

    returns

    an Observable that emits the same items as the source Observable, then invokes the function

    Definition Classes
    Observable
    Annotations
    @deprecated
    Deprecated

    (Since version 0.26.1) Use Observable.doAfterTerminate instead

  3. def flattenDelayError[U](implicit evidence: <:<[Observable[T], Observable[Observable[U]]]): Observable[U]

    Permalink

    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 Observers once.

    Scheduler:

    This method does not operate by default on a particular Scheduler.

    returns

    an Observable that emits all of the items emitted by the Observables emitted by this

    Definition Classes
    Observable
    Annotations
    @deprecated
    Deprecated

    (Since version 0.26.2) Use delayError.flatten instead

    See also

    ReactiveX operators documentation: Merge

  4. def mergeDelayError[U >: T](that: Observable[U]): Observable[U]

    Permalink

    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.

    that

    an Observable to be merged

    returns

    an Observable that emits items that are the result of flattening the items emitted by this and that

    Definition Classes
    Observable
    Annotations
    @deprecated
    Deprecated

    (Since version 0.26.2) Use delayError.merge instead

Inherited from Subject[T]

Inherited from Observer[T]

Inherited from Observable[T]

Inherited from AnyRef

Inherited from Any

Ungrouped