Trait/Object

monifu.reactive

Observable

Related Docs: object Observable | package reactive

Permalink

trait Observable[+T] extends AnyRef

Asynchronous implementation of the Observable interface

Self Type
Observable[T]
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Observable
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def subscribeFn(subscriber: Subscriber[T]): Unit

    Permalink

    Characteristic function for an Observable instance, that creates the subscription and that eventually starts the streaming of events to the given Observer, being meant to be overridden in custom combinators or in classes implementing Observable.

    Characteristic function for an Observable instance, that creates the subscription and that eventually starts the streaming of events to the given Observer, being meant to be overridden in custom combinators or in classes implementing Observable.

    Attributes
    protected

Concrete Value Members

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

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

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

    Permalink

    Concatenates the source Observable with the other Observable, as specified.

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

    Permalink

    Creates a new Observable that emits the given element and then it also emits the events of the source (prepend operation).

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

    Permalink

    Creates a new Observable that emits the events of the source and then it also emits the given element (appended to the stream).

  6. final def ==(arg0: Any): Boolean

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

    Permalink

    Given the source observable and another Observable, emits all of the items from the first of these Observables to emit an item and cancel the other.

  8. def asFuture(implicit s: Scheduler): Future[Option[T]]

    Permalink

    Returns the first generated result as a Future and then cancels the subscription.

  9. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  10. def asyncBoundary(policy: BufferPolicy = defaultPolicy): Observable[T]

    Permalink

    Forces a buffered asynchronous boundary.

    Forces a buffered asynchronous boundary.

    Internally it wraps the observer implementation given to subscribeFn into a BufferedSubscriber.

    Normally Monifu's implementation guarantees that events are not emitted concurrently, and that the publisher MUST NOT emit the next event without acknowledgement from the consumer that it may proceed, however for badly behaved publishers, this wrapper provides the guarantee that the downstream Observer given in subscribe will not receive concurrent events.

    WARNING: if the buffer created by this operator is unbounded, it can blow up the process if the data source is pushing events faster than what the observer can consume, as it introduces an asynchronous boundary that eliminates the back-pressure requirements of the data source. Unbounded is the default policy, see BufferPolicy for options.

  11. def behavior[U >: T](initialValue: U)(implicit s: Scheduler): ConnectableObservable[U]

    Permalink

    Converts this observable into a multicast observable, useful for turning a cold observable into a hot one (i.e.

    Converts this observable into a multicast observable, useful for turning a cold observable into a hot one (i.e. whose source is shared by all observers). The underlying subject used is a BehaviorSubject.

  12. def buffer(count: Int): Observable[Seq[T]]

    Permalink

    Periodically gather items emitted by an Observable into bundles and emit these bundles rather than emitting the items one at a time.

    Periodically gather items emitted by an Observable into bundles and emit these bundles rather than emitting the items one at a time. This version of buffer is emitting items once the internal buffer has the reached the given count.

    So in this example, we are creating a new observable that emits sequences of exactly 10 elements (or whatever is in the buffer when onComplete happens):

    observable.buffer(10)
    count

    the bundle size

  13. def bufferSizedAndTimed(maxSize: Int, timespan: FiniteDuration): Observable[Seq[T]]

    Permalink

    Periodically gather items emitted by an Observable into bundles and emit these bundles rather than emitting the items one at a time.

    Periodically gather items emitted by an Observable into bundles and emit these bundles rather than emitting the items one at a time.

    This version of buffer emits a new bundle of items periodically, every timespan amount of time, containing all items emitted by the source Observable since the previous bundle emission, or when the buffer size has reached the given count.

    maxSize

    is the maximum bundle size

    timespan

    the interval of time at which it should emit the buffered bundle

  14. def bufferTimed(timespan: FiniteDuration): Observable[Seq[T]]

    Permalink

    Periodically gather items emitted by an Observable into bundles and emit these bundles rather than emitting the items one at a time.

    Periodically gather items emitted by an Observable into bundles and emit these bundles rather than emitting the items one at a time.

    This version of buffer emits a new bundle of items periodically, every timespan amount of time, containing all items emitted by the source Observable since the previous bundle emission.

    timespan

    the interval of time at which it should emit the buffered bundle

  15. def clone(): AnyRef

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

    Permalink

    Returns an Observable by applying the given partial function to the source observable for each element for which the given partial function is defined.

    Returns an Observable by applying the given partial function to the source observable for each element for which the given partial function is defined.

    Useful to be used instead of a filter & map combination.

    pf

    the function that filters and maps the resulting observable

    returns

    an Observable that emits the transformed items by the given partial function

  17. def combineLatest[U](other: Observable[U]): Observable[(T, U)]

    Permalink

    Creates a new Observable from this Observable and another given Observable.

    Creates a new Observable from this Observable and another given Observable.

    This operator behaves in a similar way to zip, but while zip emits items only when all of the zipped source Observables have emitted a previously unzipped item, combine emits an item whenever any of the source Observables emits an item (so long as each of the source Observables has emitted at least one item).

  18. def combineLatestDelayError[U](other: Observable[U]): Observable[(T, U)]

    Permalink

    Creates a new Observable from this Observable and another given Observable.

    Creates a new Observable from this Observable and another given Observable.

    It's like Observable.combineLatest, except that the created observable is reserving onError notifications until all of the combined Observables complete and only then passing it along to the observers.

  19. def complete: Observable[Nothing]

    Permalink

    Returns an Observable that doesn't emit anything, but that completes when the source Observable completes.

  20. def concat[U](implicit ev: <:<[T, Observable[U]]): Observable[U]

    Permalink

    Concatenates the sequence of Observables emitted by the source into one Observable, without any transformation.

    Concatenates the sequence of Observables emitted by the source 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.

    The difference between concat and merge is that concat cares about ordering of emitted items (e.g. all items emitted by the first observable in the sequence will come before the elements emitted by the second observable), whereas merge doesn't care about that (elements get emitted as they come). Because of back-pressure applied to observables, concat is safe to use in all contexts, whereas merge requires buffering.

    returns

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

  21. def concatDelayError[U](implicit ev: <:<[T, Observable[U]]): Observable[U]

    Permalink

    Concatenates the sequence of Observables emitted by the source into one Observable, without any transformation.

    Concatenates the sequence of Observables emitted by the source into one Observable, without any transformation.

    It's like Observable.concat, except that the created observable is reserving onError notifications until all of the merged Observables complete and only then passing it along to the observers.

    returns

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

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

    Permalink

    Creates a new Observable by applying a function that you supply to each item emitted by the source Observable, where that function returns an Observable, and then concatenating those resulting Observables and emitting the results of this concatenation.

    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 concatenating those resulting Observables and emitting the results of this concatenation.

    f

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

    returns

    an Observable that emits the result of applying the transformation function to each item emitted by the source Observable and concatenating the results of the Observables obtained from this transformation.

  23. def concatMapDelayError[U](f: (T) ⇒ Observable[U]): Observable[U]

    Permalink

    Creates a new Observable by applying a function that you supply to each item emitted by the source Observable, where that function returns an Observable, and then concatenating those resulting Observables and emitting the results of this concatenation.

    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 concatenating those resulting Observables and emitting the results of this concatenation.

    It's like Observable.concatMap, except that the created observable is reserving onError notifications until all of the merged Observables complete and only then passing it along to the observers.

    f

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

    returns

    an Observable that emits the result of applying the transformation function to each item emitted by the source Observable and concatenating the results of the Observables obtained from this transformation.

  24. def count(): Observable[Long]

    Permalink

    Creates a new Observable that emits the total number of onNext events that were emitted by the source.

    Creates a new Observable that emits the total number of onNext events that were emitted by the source.

    Note that this Observable emits only one item after the source is complete. And in case the source emits an error, then only that error will be emitted.

  25. def debounce(timeout: FiniteDuration): Observable[T]

    Permalink

    Only emit an item from an Observable if a particular timespan has passed without it emitting another item.

    Only emit an item from an Observable if a particular timespan has passed without it emitting another item.

    Note: If the source Observable keeps emitting items more frequently than the length of the time window then no items will be emitted by the resulting Observable.

    timeout

    the length of the window of time that must pass after the emission of an item from the source Observable in which that Observable emits no items in order for the item to be emitted by the resulting Observable

  26. def defaultIfEmpty[U >: T](default: U): Observable[U]

    Permalink

    Emit items from the source Observable, or emit a default item if the source Observable completes after emitting no items.

  27. def delaySubscription(timespan: FiniteDuration): Observable[T]

    Permalink

    Hold an Observer's subscription request for a specified amount of time before passing it on to the source Observable.

    Hold an Observer's subscription request for a specified amount of time before passing it on to the source Observable.

    timespan

    is the time to wait before the subscription is being initiated.

  28. def delaySubscription(future: Future[_]): Observable[T]

    Permalink

    Hold an Observer's subscription request until the given future completes, before passing it on to the source Observable.

    Hold an Observer's subscription request until the given future completes, before passing it on to the source Observable. If the given future completes in error, then the subscription is terminated with onError.

    future

    the Future that must complete in order for the subscription to happen.

  29. def distinct[U](fn: (T) ⇒ U): Observable[T]

    Permalink

    Given a function that returns a key for each element emitted by the source Observable, suppress duplicates items.

    Given a function that returns a key for each element emitted by the source Observable, suppress duplicates items.

    WARNING: this requires unbounded buffering.

  30. def distinct: Observable[T]

    Permalink

    Suppress the duplicate elements emitted by the source Observable.

    Suppress the duplicate elements emitted by the source Observable.

    WARNING: this requires unbounded buffering.

  31. def distinctUntilChanged[U](fn: (T) ⇒ U): Observable[T]

    Permalink

    Suppress duplicate consecutive items emitted by the source Observable

  32. def distinctUntilChanged: Observable[T]

    Permalink

    Suppress duplicate consecutive items emitted by the source Observable

  33. def doOnCanceled(cb: ⇒ Unit): Observable[T]

    Permalink

    Executes the given callback if the downstream observer has canceled the streaming.

  34. def doOnComplete(cb: ⇒ Unit): Observable[T]

    Permalink

    Executes the given callback when the stream has ended, but before the complete event is emitted.

    Executes the given callback when the stream has ended, but before the complete event is emitted.

    cb

    the callback to execute when the subscription is canceled

  35. def doOnError(cb: (Throwable) ⇒ Unit): Observable[T]

    Permalink

    Executes the given callback when the stream is interrupted with an error, before the onError event is emitted downstream.

    Executes the given callback when the stream is interrupted with an error, before the onError event is emitted downstream.

    NOTE: should protect the code in this callback, because if it throws an exception the onError event will prefer signaling the original exception and otherwise the behavior is undefined.

  36. def doOnStart(cb: (T) ⇒ Unit): Observable[T]

    Permalink

    Executes the given callback only for the first element generated by the source Observable, useful for doing a piece of computation only when the stream started.

    Executes the given callback only for the first element generated by the source Observable, useful for doing a piece of computation only when the stream started.

    returns

    a new Observable that executes the specified callback only for the first element

  37. def doWork(cb: (T) ⇒ Unit): Observable[T]

    Permalink

    Executes the given callback for each element generated by the source Observable, useful for doing side-effects.

    Executes the given callback for each element generated by the source Observable, useful for doing side-effects.

    returns

    a new Observable that executes the specified callback for each element

  38. def drop(n: Int): Observable[T]

    Permalink

    Drops the first n elements (from the start).

    Drops the first n elements (from the start).

    n

    the number of elements to drop

    returns

    a new Observable that drops the first n elements emitted by the source

  39. def dropByTimespan(timespan: FiniteDuration): Observable[T]

    Permalink

    Creates a new Observable that drops the events of the source, only for the specified timestamp window.

    Creates a new Observable that drops the events of the source, only for the specified timestamp window.

    timespan

    the window of time during which the new Observable is must drop the events emitted by the source

  40. def dropWhile(p: (T) ⇒ Boolean): Observable[T]

    Permalink

    Drops the longest prefix of elements that satisfy the given predicate and returns a new Observable that emits the rest.

  41. def dropWhileWithIndex(p: (T, Int) ⇒ Boolean): Observable[T]

    Permalink

    Drops the longest prefix of elements that satisfy the given function and returns a new Observable that emits the rest.

    Drops the longest prefix of elements that satisfy the given function and returns a new Observable that emits the rest. In comparison with dropWhile, this version accepts a function that takes an additional parameter: the zero-based index of the element.

  42. def dump(prefix: String, out: PrintStream = System.out): Observable[T]

    Permalink

    Utility that can be used for debugging purposes.

  43. def endWith[U >: T](elems: U*): Observable[U]

    Permalink

    Creates a new Observable that emits the events of the source and then it also emits the given elements (appended to the stream).

  44. def endWithError(error: Throwable): Observable[T]

    Permalink

    Emits the given exception instead of onComplete.

    Emits the given exception instead of onComplete.

    error

    the exception to emit onComplete

    returns

    a new Observable that emits an exception onComplete

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  47. def error: Observable[Throwable]

    Permalink

    Returns an Observable that emits a single Throwable, in case an error was thrown by the source Observable, otherwise it isn't going to emit anything.

  48. def exists(p: (T) ⇒ Boolean): Observable[Boolean]

    Permalink

    Returns an Observable which emits a single value, either true, in case the given predicate holds for at least one item, or false otherwise.

    Returns an Observable which emits a single value, either true, in case the given predicate holds for at least one item, or false otherwise.

    p

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

    returns

    an Observable that emits only true or false in case the given predicate holds or not for at least one item

  49. def filter(p: (T) ⇒ Boolean): Observable[T]

    Permalink

    Returns an Observable which only emits those items for which the given predicate holds.

    Returns an Observable which only emits those items for which the given predicate holds.

    p

    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 for which the filter evaluates as true

  50. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  51. def find(p: (T) ⇒ Boolean): Observable[T]

    Permalink

    Returns an Observable which only emits the first item for which the predicate holds.

    Returns an Observable which only emits the first item for which the predicate holds.

    p

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

    returns

    an Observable that emits only the first item in the original Observable for which the filter evaluates as true

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

    Permalink

    Emits the first element emitted by the source, or otherwise if the source is completed without emitting anything, then the default is emitted.

    Emits the first element emitted by the source, or otherwise if the source is completed without emitting anything, then the default is emitted.

    Alias for headOrElse.

  53. def flatMap[U](f: (T) ⇒ Observable[U]): Observable[U]

    Permalink

    Creates a new Observable by applying a function that you supply to each item emitted by the source Observable, where that function returns an Observable, and then concatenating those resulting Observables and emitting the results of this concatenation.

    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 concatenating those resulting Observables and emitting the results of this concatenation.

    f

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

    returns

    an Observable that emits the result of applying the transformation function to each item emitted by the source Observable and concatenating the results of the Observables obtained from this transformation.

  54. def flatMapDelayError[U](f: (T) ⇒ Observable[U]): Observable[U]

    Permalink

    Creates a new Observable by applying a function that you supply to each item emitted by the source Observable, where that function returns an Observable, and then concatenating those resulting Observables and emitting the results of this concatenation.

    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 concatenating those resulting Observables and emitting the results of this concatenation.

    It's an alias for Observable.concatMapDelayError.

    f

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

    returns

    an Observable that emits the result of applying the transformation function to each item emitted by the source Observable and concatenating the results of the Observables obtained from this transformation.

  55. def flatScan[R](initial: R)(op: (R, T) ⇒ Observable[R]): Observable[R]

    Permalink

    Applies a binary operator to a start value and to elements produced by the source observable, going from left to right, producing and concatenating observables along the way.

    Applies a binary operator to a start value and to elements produced by the source observable, going from left to right, producing and concatenating observables along the way.

    It's the combination between scan and monifu.reactive.Observable.flatten.

  56. def flatScanDelayError[R](initial: R)(op: (R, T) ⇒ Observable[R]): Observable[R]

    Permalink

    Applies a binary operator to a start value and to elements produced by the source observable, going from left to right, producing and concatenating observables along the way.

    Applies a binary operator to a start value and to elements produced by the source observable, going from left to right, producing and concatenating observables along the way.

    It's the combination between scan and monifu.reactive.Observable.flattenDelayError.

  57. def flatten[U](implicit ev: <:<[T, Observable[U]]): Observable[U]

    Permalink

    Flattens the sequence of Observables emitted by the source into one Observable, without any transformation.

    Flattens the sequence of Observables emitted by the source into one Observable, without any transformation.

    It's an alias for Observable.concat.

    returns

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

  58. def flattenDelayError[U](implicit ev: <:<[T, Observable[U]]): Observable[U]

    Permalink

    Flattens the sequence of Observables emitted by the source into one Observable, without any transformation.

    Flattens the sequence of Observables emitted by the source into one Observable, without any transformation. Delays errors until the end.

    It's an alias for Observable.concatDelayError.

    returns

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

  59. def foldLeft[R](initial: R)(op: (R, T) ⇒ R): Observable[R]

    Permalink

    Applies a binary operator to a start value and all elements of this Observable, going left to right and returns a new Observable that emits only one item before onComplete.

  60. def forAll(p: (T) ⇒ Boolean): Observable[Boolean]

    Permalink

    Returns an Observable that emits a single boolean, either true, in case the given predicate holds for all the items emitted by the source, or false in case at least one item is not verifying the given predicate.

    Returns an Observable that emits a single boolean, either true, in case the given predicate holds for all the items emitted by the source, or false in case at least one item is not verifying the given predicate.

    p

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

    returns

    an Observable that emits only true or false in case the given predicate holds or not for all the items

  61. def foreach(cb: (T) ⇒ Unit)(implicit s: Scheduler): Unit

    Permalink

    Subscribes to the source Observable and foreach element emitted by the source it executes the given callback.

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

    Permalink
    Definition Classes
    AnyRef → Any
  63. def hashCode(): Int

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

    Permalink

    Only emits the first element emitted by the source observable, after which it's completed immediately.

  65. def headOrElse[B >: T](default: ⇒ B): Observable[B]

    Permalink

    Emits the first element emitted by the source, or otherwise if the source is completed without emitting anything, then the default is emitted.

  66. def isEmpty: Observable[Boolean]

    Permalink

    Returns an Observable that emits true if the source Observable is empty, otherwise false.

  67. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  68. def last: Observable[T]

    Permalink

    Only emits the last element emitted by the source observable, after which it's completed immediately.

  69. def lift[U](f: (Observable[T]) ⇒ Observable[U]): Observable[U]

    Permalink

    Given a function that transforms an Observable[T] into an Observable[U], it transforms the source observable into an Observable[U].

  70. def map[U](f: (T) ⇒ U): Observable[U]

    Permalink

    Returns an Observable that applies the given function to each item emitted by an Observable and emits the result.

    Returns an Observable that applies the given function to each item emitted by an Observable and emits the result.

    f

    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

  71. def materialize: Observable[Notification[T]]

    Permalink

    Converts the source Observable that emits T into an Observable that emits Notification[T].

    Converts the source Observable that emits T into an Observable that emits Notification[T].

    NOTE: onComplete is still emitted after an onNext(OnComplete) notification however an onError(ex) notification is emitted as an onNext(OnError(ex)) followed by an onComplete.

  72. def max[U >: T](implicit ev: Ordering[U]): Observable[U]

    Permalink

    Takes the elements of the source Observable and emits the maximum value, after the source has completed.

  73. def maxBy[U](f: (T) ⇒ U)(implicit ev: Ordering[U]): Observable[T]

    Permalink

    Takes the elements of the source Observable and emits the element that has the maximum key value, where the key is generated by the given function f.

  74. def merge[U](bufferPolicy: BufferPolicy = defaultPolicy)(implicit ev: <:<[T, Observable[U]]): Observable[U]

    Permalink

    Merges the sequence of Observables emitted by the source into one Observable, without any transformation.

    Merges the sequence of Observables emitted by the source 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.

    The difference between concat and merge is that concat cares about ordering of emitted items (e.g. all items emitted by the first observable in the sequence will come before the elements emitted by the second observable), whereas merge doesn't care about that (elements get emitted as they come). Because of back-pressure applied to observables, concat is safe to use in all contexts, whereas merge requires buffering.

    bufferPolicy

    the policy used for buffering, useful if you want to limit the buffer size and apply back-pressure, trigger and error, etc... see the available buffer policies.

    returns

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

  75. def mergeDelayError[U](bufferPolicy: BufferPolicy = defaultPolicy)(implicit ev: <:<[T, Observable[U]]): Observable[U]

    Permalink

    Merges the sequence of Observables emitted by the source into one Observable, without any transformation.

    Merges the sequence of Observables emitted by the source 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.

    It's like Observable.merge, except that the created observable is reserving onError notifications until all of the merged Observables complete and only then passing it along to the observers.

    bufferPolicy

    the policy used for buffering, useful if you want to limit the buffer size and apply back-pressure, trigger and error, etc... see the available buffer policies.

    returns

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

  76. def mergeMap[U](f: (T) ⇒ Observable[U]): Observable[U]

    Permalink

    Creates a new Observable by applying a function that you supply to each item emitted by the source Observable, where that function returns an Observable, and then merging those resulting Observables and emitting the results of this merger.

    Creates a new Observable by applying a function that you supply to each item emitted by the source Observable, where that function returns an Observable, and then merging those resulting Observables and emitting the results of this merger.

    f

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

    returns

    an Observable that emits the result of applying the transformation function to each item emitted by the source Observable and merging the results of the Observables obtained from this transformation.

  77. def mergeMapDelayError[U](f: (T) ⇒ Observable[U]): Observable[U]

    Permalink

    Creates a new Observable by applying a function that you supply to each item emitted by the source Observable, where that function returns an Observable, and then merging those resulting Observables and emitting the results of this merger.

    Creates a new Observable by applying a function that you supply to each item emitted by the source Observable, where that function returns an Observable, and then merging those resulting Observables and emitting the results of this merger.

    It's like Observable.mergeMap, except that the created observable is reserving onError notifications until all of the merged Observables complete and only then passing it along to the observers.

    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.

  78. def min[U >: T](implicit ev: Ordering[U]): Observable[U]

    Permalink

    Takes the elements of the source Observable and emits the minimum value, after the source has completed.

  79. def minBy[U](f: (T) ⇒ U)(implicit ev: Ordering[U]): Observable[T]

    Permalink

    Takes the elements of the source Observable and emits the element that has the minimum key value, where the key is generated by the given function f.

  80. def multicast[R](subject: Subject[T, R])(implicit s: Scheduler): ConnectableObservable[R]

    Permalink

    Converts this observable into a multicast observable, useful for turning a cold observable into a hot one (i.e.

    Converts this observable into a multicast observable, useful for turning a cold observable into a hot one (i.e. whose source is shared by all observers).

  81. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  82. def nonEmpty: Observable[Boolean]

    Permalink

    Returns an Observable that emits false if the source Observable is empty, otherwise true.

  83. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  85. def onErrorFallbackTo[U >: T](that: ⇒ Observable[U]): Observable[U]

    Permalink

    Returns an Observable that mirrors the behavior of the source, unless the source is terminated with an onError, in which case the streaming of events continues with the specified backup sequence.

    Returns an Observable that mirrors the behavior of the source, unless the source is terminated with an onError, in which case the streaming of events continues with the specified backup sequence.

    The created Observable mirrors the behavior of the source in case the source does not end with an error.

    NOTE that compared with onErrorResumeNext from Rx.NET, the streaming is not resumed in case the source is terminated normally with an onComplete.

    that

    - a backup sequence that's being subscribed in case the source terminates with an error.

  86. def onErrorRecoverWith[U >: T](pf: PartialFunction[Throwable, Observable[U]]): Observable[U]

    Permalink

    Returns an Observable that mirrors the behavior of the source, unless the source is terminated with an onError, in which case the streaming of events continues with the specified backup sequence generated by the given partial function.

    Returns an Observable that mirrors the behavior of the source, unless the source is terminated with an onError, in which case the streaming of events continues with the specified backup sequence generated by the given partial function.

    The created Observable mirrors the behavior of the source in case the source does not end with an error or if the thrown Throwable is not matched.

    NOTE that compared with onErrorResumeNext from Rx.NET, the streaming is not resumed in case the source is terminated normally with an onComplete.

    pf

    - a partial function that matches errors with a backup throwable that is subscribed when the source throws an error.

  87. def onErrorRetry(maxRetries: Long): Observable[T]

    Permalink

    Returns an Observable that mirrors the behavior of the source, unless the source is terminated with an onError, in which case it tries subscribing to the source again in the hope that it will complete without an error.

    Returns an Observable that mirrors the behavior of the source, unless the source is terminated with an onError, in which case it tries subscribing to the source again in the hope that it will complete without an error.

    The number of retries is limited by the specified maxRetries parameter, so for an Observable that always ends in error the total number of subscriptions that will eventually happen is maxRetries + 1.

  88. def onErrorRetryIf(p: (Throwable) ⇒ Boolean): Observable[T]

    Permalink

    Returns an Observable that mirrors the behavior of the source, unless the source is terminated with an onError, in which case it tries subscribing to the source again in the hope that it will complete without an error.

    Returns an Observable that mirrors the behavior of the source, unless the source is terminated with an onError, in which case it tries subscribing to the source again in the hope that it will complete without an error.

    The given predicate establishes if the subscription should be retried or not.

  89. def onErrorRetryUnlimited: Observable[T]

    Permalink

    Returns an Observable that mirrors the behavior of the source, unless the source is terminated with an onError, in which case it tries subscribing to the source again in the hope that it will complete without an error.

    Returns an Observable that mirrors the behavior of the source, unless the source is terminated with an onError, in which case it tries subscribing to the source again in the hope that it will complete without an error.

    NOTE: The number of retries is unlimited, so something like Observable.error(new RuntimeException).onErrorRetryUnlimited will loop forever.

  90. def publish()(implicit s: Scheduler): ConnectableObservable[T]

    Permalink

    Converts this observable into a multicast observable, useful for turning a cold observable into a hot one (i.e.

    Converts this observable into a multicast observable, useful for turning a cold observable into a hot one (i.e. whose source is shared by all observers). The underlying subject used is a PublishSubject.

  91. def publishLast()(implicit s: Scheduler): ConnectableObservable[T]

    Permalink

    Converts this observable into a multicast observable, useful for turning a cold observable into a hot one (i.e.

    Converts this observable into a multicast observable, useful for turning a cold observable into a hot one (i.e. whose source is shared by all observers). The underlying subject used is a AsyncSubject.

  92. def publisher[U >: T](implicit s: Scheduler): Publisher[U]

    Permalink

    Wraps this Observable into a org.reactivestreams.Publisher.

  93. def reduce[U >: T](op: (U, U) ⇒ U): Observable[U]

    Permalink

    Applies a binary operator to a start value and all elements of this Observable, going left to right and returns a new Observable that emits only one item before onComplete.

  94. def repeat: Observable[T]

    Permalink

    Repeats the items emitted by this Observable continuously.

    Repeats the items emitted by this Observable continuously. It caches the generated items until onComplete and repeats them ad infinitum. On error it terminates.

  95. def replay()(implicit s: Scheduler): ConnectableObservable[T]

    Permalink

    Converts this observable into a multicast observable, useful for turning a cold observable into a hot one (i.e.

    Converts this observable into a multicast observable, useful for turning a cold observable into a hot one (i.e. whose source is shared by all observers). The underlying subject used is a ReplaySubject.

  96. def sample(initialDelay: FiniteDuration, delay: FiniteDuration): Observable[T]

    Permalink

    Emit the most recent items emitted by an Observable within periodic time intervals.

    Emit the most recent items emitted by an Observable within periodic time intervals.

    Use the sample() method to periodically look at an Observable to see what item it has most recently emitted since the previous sampling. Note that if the source Observable has emitted no items since the last time it was sampled, the Observable that results from the sample( ) operator will emit no item for that sampling period.

    initialDelay

    the initial delay after which sampling can happen

    delay

    the timespan at which sampling occurs and note that this is not accurate as it is subject to back-pressure concerns - as in if the delay is 1 second and the processing of an event on onNext in the observer takes one second, then the actual sampling delay will be 2 seconds.

  97. def sample(delay: FiniteDuration): Observable[T]

    Permalink

    Emit the most recent items emitted by an Observable within periodic time intervals.

    Emit the most recent items emitted by an Observable within periodic time intervals.

    Use the sample() method to periodically look at an Observable to see what item it has most recently emitted since the previous sampling. Note that if the source Observable has emitted no items since the last time it was sampled, the Observable that results from the sample( ) operator will emit no item for that sampling period.

    delay

    the timespan at which sampling occurs and note that this is not accurate as it is subject to back-pressure concerns - as in if the delay is 1 second and the processing of an event on onNext in the observer takes one second, then the actual sampling delay will be 2 seconds.

  98. def sampleRepeated(initialDelay: FiniteDuration, delay: FiniteDuration): Observable[T]

    Permalink

    Emit the most recent items emitted by an Observable within periodic time intervals.

    Emit the most recent items emitted by an Observable within periodic time intervals. If no new value has been emitted since the last time it was sampled, the emit the last emitted value anyway.

    Also see Observable!.sample.

    initialDelay

    the initial delay after which sampling can happen

    delay

    the timespan at which sampling occurs and note that this is not accurate as it is subject to back-pressure concerns - as in if the delay is 1 second and the processing of an event on onNext in the observer takes one second, then the actual sampling delay will be 2 seconds.

  99. def sampleRepeated(delay: FiniteDuration): Observable[T]

    Permalink

    Emit the most recent items emitted by an Observable within periodic time intervals.

    Emit the most recent items emitted by an Observable within periodic time intervals. If no new value has been emitted since the last time it was sampled, the emit the last emitted value anyway.

    Also see Observable.sample.

    delay

    the timespan at which sampling occurs and note that this is not accurate as it is subject to back-pressure concerns - as in if the delay is 1 second and the processing of an event on onNext in the observer takes one second, then the actual sampling delay will be 2 seconds.

  100. def scan[R](initial: R)(op: (R, T) ⇒ R): Observable[R]

    Permalink

    Applies a binary operator to a start value and all elements of this Observable, going left to right and returns a new Observable that emits on each step the result of the applied function.

    Applies a binary operator to a start value and all elements of this Observable, going left to right and returns a new Observable that emits on each step the result of the applied function.

    Similar to foldLeft, but emits the state on each step. Useful for modeling finite state machines.

  101. def startWith[U >: T](elems: U*): Observable[U]

    Permalink

    Creates a new Observable that emits the given elements and then it also emits the events of the source (prepend operation).

  102. def subscribe(nextFn: (T) ⇒ Future[Ack])(implicit s: Scheduler): BooleanCancelable

    Permalink

    Creates the subscription and starts the stream.

  103. def subscribe()(implicit s: Scheduler): Cancelable

    Permalink

    Creates the subscription and starts the stream.

  104. def subscribe(nextFn: (T) ⇒ Future[Ack], errorFn: (Throwable) ⇒ Unit)(implicit s: Scheduler): BooleanCancelable

    Permalink

    Creates the subscription and starts the stream.

  105. def subscribe(nextFn: (T) ⇒ Future[Ack], errorFn: (Throwable) ⇒ Unit, completedFn: () ⇒ Unit)(implicit s: Scheduler): BooleanCancelable

    Permalink

    Creates the subscription and starts the stream.

  106. def subscribe(observer: Observer[T])(implicit s: Scheduler): BooleanCancelable

    Permalink

    Creates the subscription and that starts the stream.

    Creates the subscription and that starts the stream.

    observer

    is an Observer on which onNext, onComplete and onError happens, according to the Monifu Rx contract.

  107. def subscribeOn(s: Scheduler): Observable[T]

    Permalink

    Returns a new Observable that uses the specified Scheduler for initiating the subscription.

  108. def sum[U >: T](implicit ev: Numeric[U]): Observable[U]

    Permalink

    Given a source that emits numeric values, the sum operator sums up all values and at onComplete it emits the total.

  109. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Permalink

    Drops the first element of the source observable, emitting the rest.

  111. def take(timespan: FiniteDuration): Observable[T]

    Permalink

    Creates a new Observable that emits the events of the source, only for the specified timestamp, after which it completes.

    Creates a new Observable that emits the events of the source, only for the specified timestamp, after which it completes.

    timespan

    the window of time during which the new Observable is allowed to emit the events of the source

  112. def take(n: Int): Observable[T]

    Permalink

    Selects the first n elements (from the start).

    Selects the first n elements (from the start).

    n

    the number of elements to take

    returns

    a new Observable that emits only the first n elements from the source

  113. def takeRight(n: Int): Observable[T]

    Permalink

    Creates a new Observable that only emits the last n elements emitted by the source.

  114. def takeWhile(p: (T) ⇒ Boolean): Observable[T]

    Permalink

    Takes longest prefix of elements that satisfy the given predicate and returns a new Observable that emits those elements.

  115. def takeWhileNotCanceled(c: BooleanCancelable): Observable[T]

    Permalink

    Takes longest prefix of elements that satisfy the given predicate and returns a new Observable that emits those elements.

  116. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  117. def unsafeSubscribe(subscriber: Subscriber[T]): Unit

    Permalink

    Creates the subscription that eventually starts the stream.

    Creates the subscription that eventually starts the stream.

    This function is "unsafe" to call because it does not protect the calls to the given Observer implementation in regards to unexpected exceptions that violate the contract, therefore the given instance must respect its contract and not throw any exceptions when the observable calls onNext, onComplete and onError. if it does, then the behavior is undefined.

  118. def unsafeSubscribe(observer: Observer[T])(implicit s: Scheduler): Unit

    Permalink

    Creates the subscription that eventually starts the stream.

    Creates the subscription that eventually starts the stream.

    This function is "unsafe" to call because it does not protect the calls to the given Observer implementation in regards to unexpected exceptions that violate the contract, therefore the given instance must respect its contract and not throw any exceptions when the observable calls onNext, onComplete and onError. if it does, then the behavior is undefined.

    observer

    is an Observer that respects Monifu Rx contract.

  119. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  122. def whileBusyBufferEvents(bufferSize: Int): Observable[Seq[T]]

    Permalink

    While the destination observer is busy, buffers events then send whatever was buffered in one big batch.

  123. def whileBusyDropEvents: Observable[T]

    Permalink

    While the destination observer is busy, drop the incoming events.

  124. def zip[U](other: Observable[U]): Observable[(T, U)]

    Permalink

    Creates a new Observable from this Observable and another given Observable, by emitting elements combined in pairs.

    Creates a new Observable from this Observable and another given Observable, by emitting elements combined in pairs. If one of the Observable emits fewer events than the other, then the rest of the unpaired events are ignored.

Inherited from AnyRef

Inherited from Any

Ungrouped