monifu.reactive

Observable

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
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. implicit abstract def context: ExecutionContext

    Implicit execution context required for asynchronous boundaries.

  2. abstract def subscribeFn(observer: Observer[T]): Unit

    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.

    observer

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

    Attributes
    protected

Concrete Value Members

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

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

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

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

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

    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]

    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

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

    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: Future[Option[T]]

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

  9. final def asInstanceOf[T0]: T0

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

    Forces a buffered asynchronous boundary.

    Forces a buffered asynchronous boundary.

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

    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.

    Compared with concurrent / ConcurrentObserver, the acknowledgement given by BufferedObserver can be synchronous (i.e. the Future[Ack] is already completed), so the publisher can send the next event without waiting for the consumer to receive and process the previous event (i.e. the data source will receive the Continue acknowledgement once the event has been buffered, not when it has been received by its destination).

    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): ConnectableObservable[U]

    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(timespan: FiniteDuration)(implicit scheduler: Scheduler): Observable[Seq[T]]

    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

    scheduler

    is the Scheduler needed for triggering the onNext events.

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

    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.

    count

    the bundle size

  14. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  15. def complete: Observable[Nothing]

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

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

    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

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

    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.

  18. def concurrent: Observable[T]

    Wraps the observer implementation given to subscribeFn into a ConcurrentObserver.

    Wraps the observer implementation given to subscribeFn into a ConcurrentObserver.

    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, also making it thread-safe.

    WARNING: the buffer created by this operator is unbounded and can blow up the process if the data source is pushing events without following the back-pressure requirements and faster than what the destination consumer can consume. On the other hand, if the data-source does follow the back-pressure contract, than this is safe. For data sources that cannot respect the back-pressure requirements and are problematic, see async and BufferPolicy for options.

  19. def count(): Observable[Long]

    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.

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

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

  21. def delay(policy: BufferPolicy, init: (() ⇒ Unit, (Throwable) ⇒ Unit) ⇒ Cancelable): Observable[T]

    Creates an Observable that emits the events emitted by the source shifted forward in time, delay introduced by waiting for an event to happen, an event initiated by the given callback.

    Creates an Observable that emits the events emitted by the source shifted forward in time, delay introduced by waiting for an event to happen, an event initiated by the given callback.

    Example 1:

    Observable.interval(1.second)
    .delay(Unbounded, { (connect, signalError) =>
      val task = BooleanCancelable()
      future.onComplete {
        case Success(_) =>
          if (!task.isCanceled)
            connect()
        case Failure(ex) =>
          if (!task.isCanceled)
            signalError(ex)
      }
      task
    })

    In the above example, upon subscription the given function gets called, scheduling the streaming to start after a certain future is completed. During that wait period the events are buffered and after the future is finally completed, the buffer gets streamed to the observer, after which streaming proceeds as normal.

    Example 2:

    Observable.interval(1.second)
    .delay(Unbounded, { (connect, handleError) =>
      scheduler.schedule(5.seconds, {
        connect()
      })
    })

    In the above example, upon subscription the given function gets called, scheduling a task to execute after 5 seconds. During those 5 seconds the events are buffered and after those 5 seconds are elapsed, the buffer gets streamed, after which streaming proceeds as normal.

    Notes:

    - if an error happens while waiting for our event to get triggered, it can be signaled with handleError (see sample above) - only onNext and onComplete events are delayed, but not onError, as onError interrupts the delay and streams the error as soon as it can.

    policy

    is the buffering policy used, see BufferPolicy

    init

    is the function that gets called for initiating the event that finally starts the streaming sometime in the future - it takes 2 arguments, a function that must be called to start the streaming and an error handling function that must be called in case an error happened while waiting

  22. def delay(init: (() ⇒ Unit, (Throwable) ⇒ Unit) ⇒ Cancelable): Observable[T]

    Creates an Observable that emits the events emitted by the source shifted forward in time, delay introduced by waiting for an event to happen, an event initiated by the given callback.

    Creates an Observable that emits the events emitted by the source shifted forward in time, delay introduced by waiting for an event to happen, an event initiated by the given callback.

    Example 1:

    Observable.interval(1.second)
    .delay { (connect, signalError) =>
      val task = BooleanCancelable()
      future.onComplete {
        case Success(_) =>
          if (!task.isCanceled)
            connect()
        case Failure(ex) =>
          if (!task.isCanceled)
            signalError(ex)
      }
    
      task
    }

    In the above example, upon subscription the given function gets called, scheduling the streaming to start after a certain future is completed. During that wait period the events are buffered and after the future is finally completed, the buffer gets streamed to the observer, after which streaming proceeds as normal.

    Example 2:

    Observable.interval(1.second)
    .delay { (connect, handleError) =>
      scheduler.schedule(5.seconds, {
        connect()
      })
    }

    In the above example, upon subscription the given function gets called, scheduling a task to execute after 5 seconds. During those 5 seconds the events are buffered and after those 5 seconds are elapsed, the buffer gets streamed, after which streaming proceeds as normal.

    Notes:

    - only onNext and onComplete events are delayed, but not onError, as onError interrupts the delay and streams the error as soon as it can. - the default policy is being used for buffering.

    init

    is the function that gets called for initiating the event that finally starts the streaming sometime in the future - it takes 2 arguments, a function that must be called to start the streaming and an error handling function that must be called in case an error happened while waiting

  23. def delay(policy: BufferPolicy, future: Future[_]): Observable[T]

    Creates an Observable that emits the events emitted by the source, shifted forward in time, the streaming being triggered by the completion of a future.

    Creates an Observable that emits the events emitted by the source, shifted forward in time, the streaming being triggered by the completion of a future.

    During the delay period the emitted elements are being buffered. If the future is completed with a failure, then the error will get streamed directly to our observable, bypassing any buffered events that we may have.

    policy

    is the policy used for buffering, see BufferPolicy

    future

    is a Future that starts the streaming upon completion

  24. def delay(future: Future[_]): Observable[T]

    Creates an Observable that emits the events emitted by the source, shifted forward in time, the streaming being triggered by the completion of a future.

    Creates an Observable that emits the events emitted by the source, shifted forward in time, the streaming being triggered by the completion of a future.

    During the delay period the emitted elements are being buffered. If the future is completed with a failure, then the error will get streamed directly to our observable, bypassing any buffered events that we may have.

    Note: the default policy is being used for buffering.

    future

    is a Future that starts the streaming upon completion

  25. def delay(policy: BufferPolicy, itemDelay: FiniteDuration)(implicit scheduler: Scheduler): Observable[T]

    Creates an Observable that emits the events emitted by the source, shifted forward in time, specified by the given itemDelay.

    Creates an Observable that emits the events emitted by the source, shifted forward in time, specified by the given itemDelay.

    policy

    is the policy used for buffering, see BufferPolicy

    itemDelay

    is the period of time to wait before events start being signaled

    scheduler

    is the Scheduler needed for triggering the timeout.

  26. def delay(itemDelay: FiniteDuration)(implicit scheduler: Scheduler): Observable[T]

    Creates an Observable that emits the events emitted by the source, shifted forward in time, specified by the given itemDelay.

    Creates an Observable that emits the events emitted by the source, shifted forward in time, specified by the given itemDelay.

    Note: the default policy is being used for buffering.

    itemDelay

    is the period of time to wait before events start being signaled

    scheduler

    is the Scheduler needed for triggering the timeout.

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

    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.

    scheduler

    is the Scheduler needed for triggering the timeout event.

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

    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]

    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]

    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]

    Suppress duplicate consecutive items emitted by the source Observable

  32. def distinctUntilChanged: Observable[T]

    Suppress duplicate consecutive items emitted by the source Observable

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

    Executes the given callback when the stream has ended (after the event was already emitted).

    Executes the given callback when the stream has ended (after the event was already emitted).

    NOTE: protect the callback such that it doesn't throw exceptions, because it gets executed after onComplete() happens and by definition the error cannot be streamed with onError().

    cb

    the callback to execute when the subscription is canceled

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

    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

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

    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

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

    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

  37. def drop(timespan: FiniteDuration)(implicit scheduler: Scheduler): Observable[T]

    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

    scheduler

    is the Scheduler needed for triggering the timeout event.

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

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

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

    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.

  40. def dump(prefix: String): Observable[T]

    Utility that can be used for debugging purposes.

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

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

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

    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

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

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

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

    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.

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

    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

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

    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

  48. def finalize(): Unit

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

    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

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

    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.

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

    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.

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

    Given a start value (a seed) and a function taking the current state (starting with the seed) and the currently emitted item and returning a new state value as a Future, it returns a new Observable that applies the given function to all emitted items, emitting the produced state along the way.

    Given a start value (a seed) and a function taking the current state (starting with the seed) and the currently emitted item and returning a new state value as a Future, it returns a new Observable that applies the given function to all emitted items, emitting the produced state along the way.

    This operator is to scan what flatMap is to map.

    Example:

    // dumb long running function, returning a Future result
    def sumUp(x: Long, y: Int) = Future(x + y)
    
    Observable.range(0, 10).flatScan(0L)(sumUp).dump("FlatScan").subscribe()
    //=> 0: FlatScan-->0
    //=> 1: FlatScan-->1
    //=> 2: FlatScan-->3
    //=> 3: FlatScan-->6
    //=> 4: FlatScan-->10
    //=> 5: FlatScan-->15
    //=> 6: FlatScan-->21
    //=> 7: FlatScan-->28
    //=> 8: FlatScan-->36
    //=> 9: FlatScan-->45
    //=> 10: FlatScan completed

    NOTE that it does back-pressure and the state produced by this function is emitted in order of the original input. This is the equivalent of concatMap and NOT mergeMap (a mergeScan wouldn't make sense anyway).

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

    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.

    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[B]] for some B, 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

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

    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.

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

    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

  56. def foreach(cb: (T) ⇒ Unit): Unit

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

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

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

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

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

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

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

  61. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  62. def last: Observable[T]

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

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

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

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

    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

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

    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.

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

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

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

    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.

  68. def merge[U](bufferPolicy: BufferPolicy = defaultPolicy, batchSize: Int = 0)(implicit ev: <:<[T, Observable[U]]): Observable[U]

    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.

    batchSize

    a number indicating the maximum number of observables subscribed in parallel; if negative or zero, then no upper bound is applied

    returns

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

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

    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.

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

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

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

    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.

  72. def multicast[R](subject: Subject[T, R]): ConnectableObservable[R]

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

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

    Definition Classes
    AnyRef
  74. final def notify(): Unit

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

    Definition Classes
    AnyRef
  76. def observeOn(ec: ExecutionContext, bufferPolicy: BufferPolicy = defaultPolicy): Observable[T]

    Returns a new Observable that uses the specified ExecutionContext for listening to the emitted items.

    Returns a new Observable that uses the specified ExecutionContext for listening to the emitted items.

    ec

    the execution context on top of which the generated onNext / onComplete / onError events will run

    bufferPolicy

    specifies the buffering policy used by the created asynchronous boundary

  77. def publish(): ConnectableObservable[T]

    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.

  78. def publishLast(): ConnectableObservable[T]

    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.

  79. def publisher[U >: T]: Publisher[U]

    Wraps this Observable into a org.reactivestreams.Publisher.

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

    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.

  81. def repeat: Observable[T]

    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.

  82. def replay(): ConnectableObservable[T]

    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.

  83. def safe: Observable[T]

    Wraps the observer implementation given to subscribeFn into a SafeObserver.

    Wraps the observer implementation given to subscribeFn into a SafeObserver. Normally wrapping in a SafeObserver happens at the edges of the monad (in the user-facing subscribe() implementation) or in Observable subscribe implementations, so this wrapping is useful.

  84. def sample(initialDelay: FiniteDuration, delay: FiniteDuration)(implicit scheduler: Scheduler): Observable[T]

    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.

    scheduler

    is the Scheduler needed for triggering the sample events.

  85. def sample(delay: FiniteDuration)(implicit scheduler: Scheduler): Observable[T]

    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.

    scheduler

    is the Scheduler needed for triggering the sample events.

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

    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.

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

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

  88. def subscribe(nextFn: (T) ⇒ Future[Ack]): Cancelable

    Creates the subscription and starts the stream.

  89. def subscribe(): Cancelable

    Creates the subscription and starts the stream.

  90. def subscribe(nextFn: (T) ⇒ Future[Ack], errorFn: (Throwable) ⇒ Unit): Cancelable

    Creates the subscription and starts the stream.

  91. def subscribe(nextFn: (T) ⇒ Future[Ack], errorFn: (Throwable) ⇒ Unit, completedFn: () ⇒ Unit): Cancelable

    Creates the subscription and starts the stream.

  92. def subscribe(observer: Observer[T]): Cancelable

    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.

  93. def subscribeOn(ec: ExecutionContext): Observable[T]

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

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

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

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

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

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

  97. def take(timespan: FiniteDuration)(implicit scheduler: Scheduler): Observable[T]

    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

    scheduler

    is the Scheduler needed for triggering the timeout event.

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

    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

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

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

  100. def takeUntil[U](other: Observable[U]): Observable[T]

    Returns the values from the source Observable until the other Observable produces a value.

    Returns the values from the source Observable until the other Observable produces a value.

    The second Observable can cause takeUntil to quit emitting items either by emitting an event or by completing with onError or onCompleted.

  101. def takeWhile(isRefTrue: AtomicBoolean): Observable[T]

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

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

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

  103. def toString(): String

    Definition Classes
    AnyRef → Any
  104. def unsafeSubscribe(observer: Observer[T]): Unit

    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.

  105. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  108. def zip[U](other: Observable[U]): Observable[(T, U)]

    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