rx.lang.scala.subjects

AsyncSubject

class AsyncSubject[T] extends Subject[T]

Linear Supertypes
Subject[T], Observer[T], Observable[T], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. AsyncSubject
  2. Subject
  3. Observer
  4. Observable
  5. AnyRef
  6. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

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

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

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

    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]

    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]

    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

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

    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

    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.

    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
  9. def apply(observer: Observer[T]): Subscription

    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.

    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
  10. final def asInstanceOf[T0]: T0

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

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

    Definition Classes
    SubjectObserver
  13. val asJavaSubject: subjects.AsyncSubject[T]

    Definition Classes
    AsyncSubjectSubject
  14. def cache(capacity: Int): Observable[T]

    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
    Since

    0.20

    See also

    RxJava wiki: cache

  15. def cache: Observable[T]

    This method has similar behavior to rx.lang.scala.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 rx.lang.scala.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
  16. def clone(): AnyRef

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

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

    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]

    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 compose[R](transformer: (Observable[T]) ⇒ Observable[R]): Observable[R]

    Transform an Observable by applying a particular Transformer function to it.

    Transform an Observable by applying a particular Transformer function to it.

    This method operates on the Observable itself whereas Observable.lift operates on the Observable's Subscribers or Observers.

    If the operator you are creating is designed to act on the individual items emitted by a source Observable, use Observable.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.

    Scheduler:

    compose does not operate by default on a particular Scheduler.

    transformer

    implements the function that transforms the source Observable

    returns

    the source Observable, transformed by the transformer function

    Definition Classes
    Observable
    See also

    RxJava wiki: Implementing Your Own Operators

  21. def concat[U]: Observable[U]

    [use case]

    [use case]
    Definition Classes
    Observable
    Full Signature

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

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

    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 concatinating 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 concatinating 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 concatinating the Observables obtained from this transformation

    Definition Classes
    Observable
  23. def contains[U >: T](elem: U): Observable[Boolean]

    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
  24. def count(p: (T) ⇒ Boolean): Observable[Int]

    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
  25. def debounce(timeout: Duration, scheduler: Scheduler): Observable[T]

    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

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

    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

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

    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
  28. def delay(subscriptionDelay: () ⇒ Observable[Any], itemDelay: (T) ⇒ Observable[Any]): Observable[T]

    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
  29. def delay(itemDelay: (T) ⇒ Observable[Any]): Observable[T]

    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
  30. def delay(delay: Duration, scheduler: Scheduler): Observable[T]

    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
  31. def delay(delay: Duration): Observable[T]

    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
  32. def delaySubscription(delay: Duration, scheduler: Scheduler): Observable[T]

    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
  33. def delaySubscription(delay: Duration): Observable[T]

    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
  34. def dematerialize[U]: Observable[U]

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

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

    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
  36. def distinct: Observable[T]

    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
  37. def distinctUntilChanged[U](keySelector: (T) ⇒ U): Observable[T]

    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
  38. def distinctUntilChanged: Observable[T]

    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
  39. def doOnCompleted(onCompleted: ⇒ Unit): Observable[T]

    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
  40. def doOnEach(onNext: (T) ⇒ Unit, onError: (Throwable) ⇒ Unit, onCompleted: () ⇒ Unit): Observable[T]

    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
  41. def doOnEach(onNext: (T) ⇒ Unit, onError: (Throwable) ⇒ Unit): Observable[T]

    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
  42. def doOnEach(onNext: (T) ⇒ Unit): Observable[T]

    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
  43. def doOnEach(observer: Observer[T]): Observable[T]

    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
  44. def doOnError(onError: (Throwable) ⇒ Unit): Observable[T]

    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
  45. def doOnNext(onNext: (T) ⇒ Unit): Observable[T]

    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
  46. def doOnSubscribe(onSubscribe: ⇒ Unit): Observable[T]

    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

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

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

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

    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

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

    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
  50. def drop(time: Duration): Observable[T]

    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
  51. def drop(n: Int): Observable[T]

    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
  52. def dropRight(time: Duration, scheduler: Scheduler): Observable[T]

    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
  53. def dropRight(time: Duration): Observable[T]

    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
  54. def dropRight(n: Int): Observable[T]

    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
    IndexOutOfBoundsException

    if n is less than zero

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

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

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

    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
  57. def elementAt(index: Int): Observable[T]

    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
    IndexOutOfBoundsException

    if index is greater than or equal to the number of items emitted by the source Observable, or index is less than 0

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

    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
    IndexOutOfBoundsException

    if index is less than 0

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

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

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

    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
  62. def filter(predicate: (T) ⇒ Boolean): Observable[T]

    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
  63. def filterNot(p: (T) ⇒ Boolean): Observable[T]

    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
  64. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  65. def finallyDo(action: ⇒ Unit): Observable[T]

    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
  66. def first: Observable[T]

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

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

    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
  68. def flatMap[R](onNext: (T) ⇒ Observable[R], onError: (Throwable) ⇒ Observable[R], onCompleted: () ⇒ Observable[R]): Observable[R]

    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
  69. def flatMap[R](f: (T) ⇒ Observable[R]): Observable[R]

    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
  70. def flatMapIterable[R](collectionSelector: (T) ⇒ Iterable[R]): Observable[R]

    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
  71. def flatMapIterableWith[U, R](collectionSelector: (T) ⇒ Iterable[U])(resultSelector: (T, U) ⇒ R): Observable[R]

    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
  72. def flatMapWith[U, R](collectionSelector: (T) ⇒ Observable[U])(resultSelector: (T, U) ⇒ R): Observable[R]

    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
  73. def flatten[U](maxConcurrent: Int)(implicit evidence: <:<[Observable[T], Observable[Observable[U]]]): Observable[U]

    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
    IllegalArgumentException

    if maxConcurrent is less than or equal to 0

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

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

  75. def flattenDelayError[U]: Observable[U]

    [use case] This behaves like flatten except that if any of the merged Observables notify of an error via onError, this method will refrain from propagating that error notification until all of the merged Observables have finished emitting items.

    [use case]

    This behaves like flatten except that if any of the merged Observables notify of an error via onError, this method 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, this method 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.

    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 the this Observable

    Definition Classes
    Observable
    Full Signature

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

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

    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
  77. def forall(predicate: (T) ⇒ Boolean): Observable[Boolean]

    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
  78. def foreach(onNext: (T) ⇒ Unit, onError: (Throwable) ⇒ Unit, onComplete: () ⇒ Unit): Unit

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

    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
    IllegalArgumentException

    if onNext is null, or if onError is null, or if onComplete is null

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

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

    onNext

    function to execute for each item.

    onError

    function to execute when an error is emitted.

    Definition Classes
    Observable
    Since

    0.19

    Exceptions thrown
    IllegalArgumentException

    if onNext is null, or if onError is null

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

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

    onNext

    function to execute for each item.

    Definition Classes
    Observable
    Since

    0.19

    Exceptions thrown
    IllegalArgumentException

    if onNext is null

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

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

    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

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

    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
  84. def groupJoin[S, R](other: Observable[S])(leftDuration: (T) ⇒ Observable[Any], rightDuration: (S) ⇒ Observable[Any], resultSelector: (T, Observable[S]) ⇒ R): Observable[R]

    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
  85. def hashCode(): Int

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

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

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

    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
  88. def headOrElse[U >: T](default: ⇒ U): Observable[U]

    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
  89. def isEmpty: Observable[Boolean]

    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
  90. final def isInstanceOf[T0]: Boolean

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

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

  92. def last: Observable[T]

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

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

    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
  94. def lastOrElse[U >: T](default: ⇒ U): Observable[U]

    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
  95. def length: Observable[Int]

    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
  96. def lift[R](operator: (Subscriber[R]) ⇒ Subscriber[T]): Observable[R]

    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

  97. def longCount: Observable[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.

    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 emits a single item: the number of items emitted by the source Observable as a 64-bit Long item

    Definition Classes
    Observable
  98. def map[R](func: (T) ⇒ R): Observable[R]

    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
  99. def materialize: Observable[Notification[T]]

    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
  100. def merge[U >: T](that: Observable[U]): Observable[U]

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

    Definition Classes
    Observable
  101. def mergeDelayError[U >: T](that: Observable[U]): Observable[U]

    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
  102. def multicast[R >: T, U](subjectFactory: () ⇒ Subject[R])(selector: (Observable[R]) ⇒ Observable[U]): Observable[U]

    Returns an Observable that emits items produced by multicasting the source Observable within a selector function.

    Returns an Observable that emits items produced by multicasting the source Observable within a selector function.

    subjectFactory

    the Subject factory

    selector

    the selector function, which can use the multicasted source Observable subject to the policies enforced by the created Subject

    returns

    an Observable that emits the items produced by multicasting the source Observable within a selector function

    Definition Classes
    Observable
  103. def multicast[R >: T](subject: ⇒ Subject[R]): ConnectableObservable[R]

    Returns a rx.lang.scala.observables.ConnectableObservable that upon calling the connect function causes the source Observable to push results into the specified subject.

    Returns a rx.lang.scala.observables.ConnectableObservable that upon calling the connect function causes the source Observable to push results into the specified subject.

    subject

    the rx.lang.scala.subjects.Subject to push source items into. Note: this is a by-name parameter.

    returns

    a rx.lang.scala.observables.ConnectableObservable such that when the connect function is called, the Observable starts to push results into the specified Subject

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

    Definition Classes
    AnyRef
  105. def nest: Observable[Observable[T]]

    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
  106. def nonEmpty: Observable[Boolean]

    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
  107. final def notify(): Unit

    Definition Classes
    AnyRef
  108. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  109. def observeOn(scheduler: Scheduler): Observable[T]

    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
  110. def onBackpressureBuffer: Observable[T]

    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

  111. def onBackpressureDrop: Observable[T]

    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

  112. def onCompleted(): Unit

    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
  113. def onError(error: Throwable): Unit

    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
  114. def onErrorResumeNext[U >: T](resumeSequence: Observable[U]): Observable[U]

    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 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
  115. def onErrorResumeNext[U >: T](resumeFunction: (Throwable) ⇒ Observable[U]): Observable[U]

    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
  116. def onErrorReturn[U >: T](resumeFunction: (Throwable) ⇒ U): Observable[U]

    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
  117. def onExceptionResumeNext[U >: T](resumeSequence: Observable[U]): Observable[U]

    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
  118. def onNext(value: T): Unit

    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
  119. def orElse[U >: T](default: ⇒ U): Observable[U]

    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
  120. def product: Observable[T]

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

  121. def publish[R](selector: (Observable[T]) ⇒ Observable[R], initialValue: T): Observable[R]

    Returns an Observable that emits initialValue followed by 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 initialValue followed by the results of invoking a specified selector on items emitted by a ConnectableObservable that shares a single subscription to the source Observable.

    selector

    a function that can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source Observable. Subscribers to the source will receive all notifications of the source from the time of the subscription forward

    initialValue

    the initial value of the underlying BehaviorSubject

    returns

    an Observable that emits initialValue followed by the results of invoking the selector on a ConnectableObservable that shares a single subscription to the underlying Observable

    Definition Classes
    Observable
  122. def publish[R](selector: (Observable[T]) ⇒ Observable[R]): Observable[R]

    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
  123. def publish[T](initialValue: T): ConnectableObservable[T]

    Returns a ConnectableObservable that emits initialValue followed by the items emitted by this Observable.

    Returns a ConnectableObservable that emits initialValue followed by the items emitted by this Observable.

    initialValue

    the initial value to be emitted by the resulting ConnectableObservable

    returns

    a ConnectableObservable that shares a single subscription to the underlying Observable and starts with initialValue

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

    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
  125. def publishLast[R](selector: (Observable[T]) ⇒ Observable[R]): Observable[R]

    Returns an Observable that emits an item that results from invoking a specified selector on the last item emitted by a ConnectableObservable that shares a single subscription to the source Observable.

    Returns an Observable that emits an item that results from invoking a specified selector on the last item emitted by a ConnectableObservable that shares a single subscription to the source Observable.

    selector

    a function that can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source Observable. Subscribers to the source will only receive the last item emitted by the source.

    returns

    an Observable that emits an item that is the result of invoking the selector on a ConnectableObservable that shares a single subscription to the source Observable

    Definition Classes
    Observable
  126. def publishLast: ConnectableObservable[T]

    Returns a ConnectableObservable that emits only the last item emitted by the source Observable.

    Returns a ConnectableObservable that emits only the last item emitted by the source Observable. A ConnectableObservable resembles an ordinary Observable, except that it does not begin emitting items when it is subscribed to, but only when its connect method is called.

    returns

    a ConnectableObservable that emits only the last item emitted by the source Observable

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

    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
  128. def repeat(count: Long, scheduler: Scheduler): Observable[T]

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

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

    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
    IllegalArgumentException

    if count is less than zero

    See also

    MSDN: Observable.Repeat

    RxJava Wiki: repeat()

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

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

  131. def repeat: Observable[T]

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

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

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

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

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

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

    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
  135. def replay(time: Duration, scheduler: Scheduler): ConnectableObservable[T]

    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
  136. def replay(time: Duration): ConnectableObservable[T]

    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
  137. def replay(bufferSize: Int, scheduler: Scheduler): ConnectableObservable[T]

    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
  138. def replay(bufferSize: Int): ConnectableObservable[T]

    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
  139. def replay[R](selector: (Observable[T]) ⇒ Observable[R], time: Duration): Observable[R]

    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
  140. def replay(bufferSize: Int, time: Duration, scheduler: Scheduler): ConnectableObservable[T]

    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
    IllegalArgumentException

    if bufferSize is less than zero

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

    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
  142. def replay[R](selector: (Observable[T]) ⇒ Observable[R], scheduler: Scheduler): Observable[R]

    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
  143. def replay[R](selector: (Observable[T]) ⇒ Observable[R], time: Duration, scheduler: Scheduler): Observable[R]

    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
  144. def replay[R](selector: (Observable[T]) ⇒ Observable[R], bufferSize: Int, scheduler: Scheduler): Observable[R]

    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
  145. def replay[R](selector: (Observable[T]) ⇒ Observable[R], bufferSize: Int, time: Duration, scheduler: Scheduler): Observable[R]

    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
    IllegalArgumentException

    if bufferSize is less than zero

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

    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
  147. def replay[R](selector: (Observable[T]) ⇒ Observable[R], bufferSize: Int): Observable[R]

    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
  148. def replay[R](selector: (Observable[T]) ⇒ Observable[R]): Observable[R]

    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
  149. def replay: ConnectableObservable[T]

    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
  150. def retry(predicate: (Int, Throwable) ⇒ Boolean): Observable[T]

    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
  151. def retry: Observable[T]

    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
  152. def retry(retryCount: Long): Observable[T]

    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
  153. def retryWhen(notificationHandler: (Observable[Throwable]) ⇒ Observable[Any], scheduler: Scheduler): Observable[T]

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

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

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

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

    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
  156. def sample(duration: Duration, scheduler: Scheduler): Observable[T]

    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
  157. def sample(duration: Duration): Observable[T]

    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
  158. def scan[U >: T](accumulator: (U, U) ⇒ U): Observable[U]

    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
  159. def scan[R](initialValue: R)(accumulator: (R, T) ⇒ R): Observable[R]

    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
  160. def sequenceEqual[U >: T](that: Observable[U]): Observable[Boolean]

    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
  161. def sequenceEqualWith[U >: T](that: Observable[U])(equality: (U, U) ⇒ Boolean): Observable[Boolean]

    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
  162. def serialize: Observable[T]

    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
  163. def share: Observable[T]

    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

  164. def single: Observable[T]

    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
    IllegalArgumentException

    if the source emits more than one item

    NoSuchElementException

    if the source emits no items

    See also

    "MSDN: Observable.singleAsync()"

    RxJava Wiki: single()

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

    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
    IllegalArgumentException

    if the source Observable emits more than one item

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

    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
    IllegalArgumentException

    if the source Observable emits more than one item

  167. def size: Observable[Int]

    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
  168. def sliding(timespan: Duration, timeshift: Duration, count: Int, scheduler: Scheduler): Observable[Observable[T]]

    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

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

    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
  170. def sliding(timespan: Duration, timeshift: Duration): Observable[Observable[T]]

    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
  171. def sliding(count: Int, skip: Int): Observable[Observable[T]]

    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
  172. def sliding[Opening](openings: Observable[Opening])(closings: (Opening) ⇒ Observable[Any]): Observable[Observable[T]]

    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
  173. def slidingBuffer(timespan: Duration, timeshift: Duration, scheduler: Scheduler): Observable[Seq[T]]

    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
  174. def slidingBuffer(timespan: Duration, timeshift: Duration): Observable[Seq[T]]

    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
  175. def slidingBuffer(count: Int, skip: Int): Observable[Seq[T]]

    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
  176. def slidingBuffer[Opening](openings: Observable[Opening])(closings: (Opening) ⇒ Observable[Any]): Observable[Seq[T]]

    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
  177. def subscribe(onNext: (T) ⇒ Unit, onError: (Throwable) ⇒ Unit, onCompleted: () ⇒ Unit): Subscription

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

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

    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
  178. def subscribe(onNext: (T) ⇒ Unit, onError: (Throwable) ⇒ Unit): Subscription

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

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

    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
  179. def subscribe(onNext: (T) ⇒ Unit): Subscription

    Call this method to receive items from this observable.

    Call this method to receive items from this observable.

    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
  180. def subscribe(subscriber: Subscriber[T]): Subscription

    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.

    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
  181. def subscribe(observer: Observer[T]): Subscription

    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.

    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
  182. def subscribe(): Subscription

    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.

    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
  183. def subscribeOn(scheduler: Scheduler): Observable[T]

    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
  184. def sum: Observable[T]

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

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

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

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

    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
  187. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  188. def tail: Observable[T]

    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
  189. def take(time: Duration, scheduler: Scheduler): Unit

    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
  190. def take(time: Duration): Observable[T]

    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
  191. def take(n: Int): Observable[T]

    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
  192. def takeRight(count: Int, time: Duration, scheduler: Scheduler): Observable[T]

    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
    IllegalArgumentException

    if count is less than zero

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

    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
    IllegalArgumentException

    if count is less than zero

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

    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
  195. def takeRight(time: Duration): Observable[T]

    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
  196. def takeRight(count: Int): Observable[T]

    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
  197. def takeUntil(that: Observable[Any]): Observable[T]

    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
  198. def takeWhile(predicate: (T) ⇒ Boolean): Observable[T]

    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
  199. def throttleFirst(skipDuration: Duration): Observable[T]

    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
  200. def throttleFirst(skipDuration: Duration, scheduler: Scheduler): Observable[T]

    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
  201. def throttleLast(intervalDuration: Duration, scheduler: Scheduler): Observable[T]

    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
  202. def throttleLast(intervalDuration: Duration): Observable[T]

    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
  203. def throttleWithTimeout(timeout: Duration, scheduler: Scheduler): Observable[T]

    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

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

    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

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

    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
  206. def timeInterval: Observable[(Duration, T)]

    Returns an Observable that emits records of the time interval between consecutive items emitted by the source Obsegrvable.

    Returns an Observable that emits records of the time interval between consecutive items emitted by the source Obsegrvable.

    returns

    an Observable that emits time interval information items

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

    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
  208. def timeout(firstTimeoutSelector: () ⇒ Observable[Any], timeoutSelector: (T) ⇒ Observable[Any]): Observable[T]

    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
  209. def timeout[U >: T](timeoutSelector: (T) ⇒ Observable[Any], other: Observable[U]): Observable[U]

    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
  210. def timeout(timeoutSelector: (T) ⇒ Observable[Any]): Observable[T]

    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
  211. def timeout[U >: T](timeout: Duration, other: Observable[U], scheduler: Scheduler): Observable[U]

    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
  212. def timeout(timeout: Duration, scheduler: Scheduler): Observable[T]

    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
  213. def timeout[U >: T](timeout: Duration, other: Observable[U]): Observable[U]

    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
  214. def timeout(timeout: Duration): Observable[T]

    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
  215. def timestamp(scheduler: Scheduler): Observable[(Long, T)]

    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
  216. def timestamp: Observable[(Long, T)]

    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
  217. def to[Col[_]](implicit cbf: CanBuildFrom[Nothing, T, Col[T]]): Observable[Col[T]]

    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
  218. def toArray[U >: T](implicit arg0: ClassTag[U]): Observable[Array[U]]

    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
  219. def toBlocking: BlockingObservable[T]

    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

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

    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
  221. def toIndexedSeq: Observable[IndexedSeq[T]]

    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
  222. def toIterable: Observable[Iterable[T]]

    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
  223. def toIterator: Observable[Iterator[T]]

    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
  224. def toList: Observable[List[T]]

    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
  225. def toMap[K, V](keySelector: (T) ⇒ K, valueSelector: (T) ⇒ V, mapFactory: () ⇒ Map[K, V]): Observable[Map[K, V]]

    Return an Observable that emits a single Map, returned by a specified mapFactory function, that contains keys and values extracted from the items emitted by the source Observable.

    Return an Observable that emits a single Map, returned by a specified mapFactory function, that contains keys and values extracted from the items emitted by the source Observable.

    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 the source items to be used as value in the Map

    mapFactory

    the function that returns a Map instance to be used

    returns

    an Observable that emits a single item: a Map that contains the mapped items emitted by the source Observable

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

    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: a HashMap containing the mapped items from the source Observable

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

    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: a Map containing the mapped items from the source Observable

    Definition Classes
    Observable
  228. def toMultimap[K, V, B <: Buffer[V], M <: Map[K, B]](keySelector: (T) ⇒ K, valueSelector: (T) ⇒ V, mapFactory: () ⇒ M, bufferFactory: (K) ⇒ B): Observable[M]

    Returns an Observable that emits a single mutable.Map[K, B], returned by a specified mapFactory 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.Map[K, B], returned by a specified mapFactory function, that contains values extracted by a specified valueSelector function from items emitted by the source Observable, and keyed by the keySelector function. mutable.Map[K, B] is the same instance create by mapFactory.

    keySelector

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

    valueSelector

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

    mapFactory

    the function that returns a Map instance to be used

    bufferFactory

    the function that returns a mutable.Buffer[V] instance for a particular key to be used in the Map

    returns

    an Observable that emits a single item: a mutable.Map[K, B] that contains mapped items from the source Observable.

    Definition Classes
    Observable
  229. def toMultimap[K, V, M <: Map[K, Buffer[V]]](keySelector: (T) ⇒ K, valueSelector: (T) ⇒ V, mapFactory: () ⇒ M): Observable[M]

    Returns an Observable that emits a single mutable.Map[K, mutable.Buffer[V]], returned by a specified mapFactory 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.Map[K, mutable.Buffer[V]], returned by a specified mapFactory function, that contains values, extracted by a specified valueSelector function from items emitted by the source Observable and keyed by the keySelector function. mutable.Map[K, B] is the same instance create by mapFactory.

    keySelector

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

    valueSelector

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

    mapFactory

    he function that returns a mutable.Map[K, mutable.Buffer[V]] instance to be used

    returns

    an Observable that emits a single item: a mutable.Map[K, mutable.Buffer[V]] that contains items mapped from the source Observable

    Definition Classes
    Observable
  230. def toMultimap[K, V](keySelector: (T) ⇒ K, valueSelector: (T) ⇒ V): Observable[Map[K, Seq[V]]]

    Returns an Observable that emits a single Map that contains an Seq of 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 Map that contains an Seq of values extracted by a specified valueSelector function from items emitted by the source Observable, keyed by a specified keySelector function.

    keySelector

    the function that extracts a key from the source items to be used as key in the HashMap

    valueSelector

    the function that extracts a value from the source items to be used as value in the HashMap

    returns

    an Observable that emits a single item: a Map that contains an Seq of items mapped from the source Observable

    Definition Classes
    Observable
  231. def toMultimap[K](keySelector: (T) ⇒ K): Observable[Map[K, Seq[T]]]

    Returns an Observable that emits a single Map that contains an Seq of items emitted by the source Observable keyed by a specified keySelector function.

    Returns an Observable that emits a single Map that contains an Seq of items emitted by the source Observable keyed by a specified keySelector function.

    keySelector

    the function that extracts the key from the source items to be used as key in the HashMap

    returns

    an Observable that emits a single item: a Map that contains an Seq of items mapped from the source Observable

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

    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
  233. def toSet[U >: T]: Observable[Set[U]]

    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
  234. def toStream: Observable[Stream[T]]

    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
  235. def toString(): String

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

    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
  237. def toVector: Observable[Vector[T]]

    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
  238. def tumbling(timespan: Duration, count: Int, scheduler: Scheduler): Observable[Observable[T]]

    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
  239. def tumbling(timespan: Duration, count: Int): Observable[Observable[T]]

    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
  240. def tumbling(timespan: Duration, scheduler: Scheduler): Observable[Observable[T]]

    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
  241. def tumbling(timespan: Duration): Observable[Observable[T]]

    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
  242. def tumbling(count: Int): Observable[Observable[T]]

    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
  243. def tumbling(boundary: ⇒ Observable[Any]): Observable[Observable[T]]

    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
  244. def tumblingBuffer(boundary: Observable[Any], initialCapacity: Int): Observable[Seq[T]]

    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
  245. def tumblingBuffer(boundary: ⇒ Observable[Any]): Observable[Seq[T]]

    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
  246. def tumblingBuffer(timespan: Duration, count: Int, scheduler: Scheduler): Observable[Seq[T]]

    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
  247. def tumblingBuffer(timespan: Duration, count: Int): Observable[Seq[T]]

    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
  248. def tumblingBuffer(timespan: Duration, scheduler: Scheduler): Observable[Seq[T]]

    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
  249. def tumblingBuffer(timespan: Duration): Observable[Seq[T]]

    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
  250. def tumblingBuffer(count: Int): Observable[Seq[T]]

    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
  251. def unsafeSubscribe(subscriber: Subscriber[T]): Subscription

    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.

    subscriber
    returns

    Subscription which is the Subscriber passed in

    Definition Classes
    Observable
    Since

    0.17

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

    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

  253. final def wait(): Unit

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

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

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

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

    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
  258. def zip[U](that: Observable[U]): Observable[(T, U)]

    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
  259. def zipWith[U, R](that: Observable[U])(selector: (T, U) ⇒ R): Observable[R]

    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
  260. def zipWith[U, R](that: Iterable[U])(selector: (T, U) ⇒ R): Observable[R]

    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
  261. def zipWithIndex: Observable[(T, Int)]

    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

Inherited from Subject[T]

Inherited from Observer[T]

Inherited from Observable[T]

Inherited from AnyRef

Inherited from Any

Ungrouped