monix.reactive.subjects

BehaviorSubject

final class BehaviorSubject[T] extends Subject[T, T]

BehaviorSubject when subscribed, will emit the most recently emitted item by the source, or the initialValue (as the seed) in case no value has yet been emitted, then continuing to emit events subsequent to the time of invocation.

When the source terminates in error, the BehaviorSubject will not emit any items to subsequent subscribers, but instead it will pass along the error notification.

Self Type
BehaviorSubject[T]
See also

Subject

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

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Concatenates the source with another observable.

    Concatenates the source with another observable.

    Ordering of subscription is preserved, so the second observable starts only after the source observable is completed successfully with an onComplete. On the other hand, the second observable is never subscribed if the source completes with an error.

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

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

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

    Definition Classes
    ObservableLike
  6. def :+[B >: T](elem: B): Observable[B]

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

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

    Definition Classes
    ObservableLike
  7. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  8. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  9. def ambWith[B >: T](other: Observable[B]): Observable[B]

    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.

    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.

    Definition Classes
    ObservableLike
  10. def asFuture(implicit s: Scheduler): CancelableFuture[Option[T]]

    Returns the first generated result as a CancelableFuture, returning an Option because the source can be empty.

    Returns the first generated result as a CancelableFuture, returning an Option because the source can be empty.

    Definition Classes
    Observable
  11. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  12. def asTask: Task[Option[T]]

    Creates a new Task that upon execution will signal the first generated element of the source observable and then it will stop the stream.

    Creates a new Task that upon execution will signal the first generated element of the source observable and then it will stop the stream. Returns an Option because the source can be empty.

    Definition Classes
    Observable
  13. def asyncBoundary[B >: T](overflowStrategy: OverflowStrategy[B]): Observable[B]

    Forces a buffered asynchronous boundary.

    Forces a buffered asynchronous boundary.

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

    Normally Monix'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 overflowStrategy, see OverflowStrategy for options.

    overflowStrategy

    - the overflow strategy used for buffering, which specifies what to do in case we're dealing with a slow consumer - should an unbounded buffer be used, should back-pressure be applied, should the pipeline drop newer or older events, should it drop the whole buffer? See OverflowStrategy for more details.

    Definition Classes
    ObservableLike
  14. def behavior[B >: T](initialValue: B)(implicit s: Scheduler): ConnectableObservable[B]

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

    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.

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

    Returns an observable that emits buffers of items it collects from the source observable.

    Returns an observable that emits buffers of items it collects from the source observable. The resulting observable emits buffers every skip items, each containing count items.

    If the source observable completes, then the current buffer gets signaled downstream. If the source triggers an error then the current buffer is being dropped and the error gets propagated immediately.

    For count and skip there are 3 possibilities:

    1. in case skip == count, then there are no items dropped and no overlap, the call being equivalent to buffer(count) 2. in case skip < count, then overlap between buffers happens, with the number of elements being repeated being count - skip 3. in case skip > count, then skip - count elements start getting dropped between windows
    count

    the maximum size of each buffer before it should be emitted

    skip

    how many items emitted by the source observable should be skipped before starting a new buffer. Note that when skip and count are equal, this is the same operation as buffer(count)

    Definition Classes
    ObservableLike
  16. 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. This version of buffer is emitting items once the internal buffer has reached the given count.

    If the source observable completes, then the current buffer gets signaled downstream. If the source triggers an error then the current buffer is being dropped and the error gets propagated immediately.

    count

    the maximum size of each buffer before it should be emitted

    Definition Classes
    ObservableLike
  17. def bufferTimed(timespan: FiniteDuration, maxSize: 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.

    The resulting observable emits connected, non-overlapping buffers, each of a fixed duration specified by the timespan argument or a maximum size specified by the maxSize argument (whichever is reached first).

    If the source observable completes, then the current buffer gets signaled downstream. If the source triggers an error then the current buffer is being dropped and the error gets propagated immediately.

    timespan

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

    maxSize

    is the maximum bundle size

    Definition Classes
    ObservableLike
  18. def bufferTimed(timespan: FiniteDuration): 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.

    If the source observable completes, then the current buffer gets signaled downstream. If the source triggers an error then the current buffer is being dropped and the error gets propagated immediately.

    timespan

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

    Definition Classes
    ObservableLike
  19. def cache(maxCapacity: Int): Observable[T]

    Caches the emissions from the source Observable and replays them in order to any subsequent Subscribers.

    Caches the emissions from the source Observable and replays them in order to any subsequent Subscribers. This operator has similar behavior to replay except that this auto-subscribes to the source Observable rather than returning a ConnectableObservable for which you must call connect to activate the subscription.

    When you call cache, it does not yet subscribe to the source Observable and so does not yet begin caching items. This only happens when the first Subscriber calls the resulting Observable's subscribe method.

    maxCapacity

    is the maximum buffer size after which old events start being dropped (according to what happens when using ReplaySubject.createWithSize)

    returns

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

    Definition Classes
    Observable
  20. def cache: Observable[T]

    Caches the emissions from the source Observable and replays them in order to any subsequent Subscribers.

    Caches the emissions from the source Observable and replays them in order to any subsequent Subscribers. This operator has similar behavior to replay except that this auto-subscribes to the source Observable rather than returning a ConnectableObservable for which you must call connect to activate the subscription.

    When you call cache, it does not yet subscribe to the source Observable and so does not yet begin caching items. This only happens when the first Subscriber calls the resulting Observable's subscribe method.

    Note: You sacrifice the ability to cancel the origin when you use the cache operator so be careful not to use this on Observables that emit an infinite or very large number of items that will use up memory.

    returns

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

    Definition Classes
    Observable
  21. def clone(): AnyRef

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

    Applies the given partial function to the source for each element for which the given partial function is defined.

    Applies the given partial function to the source for each element for which the given partial function is defined.

    pf

    the function that filters and maps the source

    returns

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

    Definition Classes
    ObservableLike
  23. def combineLatest[B](other: Observable[B]): Observable[(T, B)]

    Creates a new observable from the source and another given observable, by emitting elements combined in pairs.

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

    See zip for an alternative that pairs the items in strict sequence.

    other

    is an observable that gets paired with the source

    Definition Classes
    ObservableLike
  24. def combineLatestWith[B, R](other: Observable[B])(f: (T, B) ⇒ R): Observable[R]

    Creates a new observable from the source and another given observable, by emitting elements combined in pairs.

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

    See zipWith for an alternative that pairs the items in strict sequence.

    other

    is an observable that gets paired with the source

    f

    is a mapping function over the generated pairs

    Definition Classes
    ObservableLike
  25. def completed: Observable[Nothing]

    Ignores all items emitted by the source Observable and only calls onCompleted or onError.

    Ignores all items emitted by the source Observable and only calls onCompleted or onError.

    returns

    an empty Observable that only calls onCompleted or onError, based on which one is called by the source Observable

    Definition Classes
    ObservableLike
  26. def concat[B](implicit ev: <:<[T, Observable[B]]): Observable[B]

    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 sequence by using this operator.

    The difference between the concat operation and mergeis that concat cares about the ordering of sequences (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 the source

    Definition Classes
    ObservableLike
  27. def concatDelayError[B](implicit ev: <:<[T, Observable[B]]): Observable[B]

    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 sequence by using this operator.

    The difference between the concat operation and mergeis that concat cares about the ordering of sequences (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.

    This version is reserving onError notifications until all of the observables complete and only then passing the issued errors(s) downstream. Note that the streamed error is a CompositeException, since multiple errors from multiple streams can happen.

    returns

    an observable that emits items that are the result of flattening the items emitted by the observables emitted by the source

    Definition Classes
    ObservableLike
  28. def concatMap[B](f: (T) ⇒ Observable[B]): Observable[B]

    Applies a function that you supply to each item emitted by the source observable, where that function returns observables, and then concatenating those resulting sequences and emitting the results of this concatenation.

    Applies a function that you supply to each item emitted by the source observable, where that function returns observables, and then concatenating those resulting sequences and emitting the results of this concatenation.

    The difference between the concat operation and mergeis that concat cares about the ordering of sequences (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.

    Definition Classes
    ObservableLike
  29. def concatMapDelayError[B](f: (T) ⇒ Observable[B]): Observable[B]

    Applies a function that you supply to each item emitted by the source observable, where that function returns sequences and then concatenating those resulting sequences and emitting the results of this concatenation.

    Applies a function that you supply to each item emitted by the source observable, where that function returns sequences and then concatenating those resulting sequences and emitting the results of this concatenation.

    This version is reserving onError notifications until all of the observables complete and only then passing the issued errors(s) downstream. Note that the streamed error is a CompositeException, since multiple errors from multiple streams can happen.

    f

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

    returns

    an observable that emits items that are the result of flattening the items emitted by the observables emitted by the source

    Definition Classes
    ObservableLike
  30. def countF: 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.

    Definition Classes
    ObservableLike
  31. def debounce(timeout: FiniteDuration): Observable[T]

    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

    Definition Classes
    ObservableLike
    See also

    echoOnce for a similar operator that also mirrors the source observable

  32. def debounceRepeated(period: FiniteDuration): Observable[T]

    Emits the last item from the source Observable if a particular timespan has passed without it emitting another item, and keeps emitting that item at regular intervals until the source breaks the silence.

    Emits the last item from the source Observable if a particular timespan has passed without it emitting another item, and keeps emitting that item at regular intervals until the source breaks the silence.

    So compared to regular debounceTo this version keeps emitting the last item of the source.

    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.

    period

    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 at regular intervals, also determined by period

    Definition Classes
    ObservableLike
    See also

    echoRepeated for a similar operator that also mirrors the source observable

  33. def debounceTo[B](timeout: FiniteDuration, f: (T) ⇒ Observable[B]): Observable[B]

    Doesn't emit anything until a timeout period passes without the source emitting anything.

    Doesn't emit anything until a timeout period passes without the source emitting anything. When that timeout happens, we subscribe to the observable generated by the given function, an observable that will keep emitting until the source will break the silence by emitting another event.

    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

    f

    is a function that receives the last element generated by the source, generating an observable to be subscribed when the source is timing out

    Definition Classes
    ObservableLike
  34. def defaultIfEmpty[B >: T](default: ⇒ B): Observable[B]

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

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

    Definition Classes
    ObservableLike
  35. def delayOnComplete(delay: FiniteDuration): Observable[T]

    Delays emitting the final onComplete event by the specified amount.

    Delays emitting the final onComplete event by the specified amount.

    Definition Classes
    ObservableLike
  36. def delayOnNext(duration: FiniteDuration): Observable[T]

    Returns an Observable that emits the items emitted by the source Observable shifted forward in time by a specified delay.

    Returns an Observable that emits the items emitted by the source Observable shifted forward in time by a specified delay.

    Each time the source Observable emits an item, delay starts a timer, and when that timer reaches the given duration, the Observable returned from delay emits the same item.

    NOTE: this delay refers strictly to the time between the onNext event coming from our source and the time it takes the downstream observer to get this event. On the other hand the operator is also applying back-pressure, so on slow observers the actual time passing between two successive events may be higher than the specified duration.

    duration

    - the delay to shift the source by

    returns

    the source Observable shifted in time by the specified delay

    Definition Classes
    ObservableLike
  37. def delayOnNextBySelector[B](selector: (T) ⇒ Observable[B]): Observable[T]

    Returns an Observable that emits the items emitted by the source Observable shifted forward in time.

    Returns an Observable that emits the items emitted by the source Observable shifted forward in time.

    This variant of delay sets its delay duration on a per-item basis by passing each item from the source Observable into a function that returns an Observable and then monitoring those Observables. When any such Observable emits an item or completes, the Observable returned by delay emits the associated item.

    selector

    is a function that returns an Observable for each item emitted by the source Observable, which is then used to delay the emission of that item by the resulting Observable until the Observable returned from selector emits an item

    returns

    the source Observable shifted in time by the specified delay

    Definition Classes
    ObservableLike
  38. def delaySubscription(timespan: FiniteDuration): 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.

    Definition Classes
    ObservableLike
  39. def delaySubscriptionWith(trigger: Observable[Any]): Observable[T]

    Hold an Observer's subscription request until the given trigger observable either emits an item or completes, before passing it on to the source Observable.

    Hold an Observer's subscription request until the given trigger observable either emits an item or completes, before passing it on to the source Observable.

    If the given trigger completes in error, then the subscription is terminated with onError.

    trigger

    the observable that must either emit an item or complete in order for the source to be subscribed.

    Definition Classes
    ObservableLike
  40. def dematerialize[B](implicit ev: <:<[T, Notification[B]]): Observable[B]

    Converts the source Observable that emits Notification[A] (the result of materialize) back to an Observable that emits A.

    Converts the source Observable that emits Notification[A] (the result of materialize) back to an Observable that emits A.

    Definition Classes
    ObservableLike
  41. 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.

    Definition Classes
    ObservableLike
  42. def distinctByKey[K](key: (T) ⇒ K): 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.

    Definition Classes
    ObservableLike
  43. def distinctUntilChanged: Observable[T]

    Suppress duplicate consecutive items emitted by the source Observable

    Suppress duplicate consecutive items emitted by the source Observable

    Definition Classes
    ObservableLike
  44. def distinctUntilChangedByKey[K](key: (T) ⇒ K): Observable[T]

    Suppress duplicate consecutive items emitted by the source Observable

    Suppress duplicate consecutive items emitted by the source Observable

    Definition Classes
    ObservableLike
  45. def doOnCancel(cb: ⇒ Unit): Observable[T]

    Executes the given callback if the downstream observer has canceled the streaming by returning Cancel as a result of onNext.

    Executes the given callback if the downstream observer has canceled the streaming by returning Cancel as a result of onNext.

    Definition Classes
    ObservableLike
  46. def doOnComplete(cb: ⇒ Unit): Observable[T]

    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

    Definition Classes
    ObservableLike
  47. def doOnError(cb: (Throwable) ⇒ Unit): Observable[T]

    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.

    Definition Classes
    ObservableLike
  48. def doOnNext(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

    Definition Classes
    ObservableLike
  49. 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 starts.

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

    returns

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

    Definition Classes
    ObservableLike
  50. def doOnSubscribe(cb: ⇒ Unit): Observable[T]

    Executes the given callback before the subscription happens.

    Executes the given callback before the subscription happens.

    Definition Classes
    ObservableLike
  51. 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

    Definition Classes
    ObservableLike
  52. def dropByTimespan(timespan: FiniteDuration): 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 must drop events emitted by the source

    Definition Classes
    ObservableLike
  53. def dropLast(n: Int): Observable[T]

    Drops the last n elements (from the end).

    Drops the last n elements (from the end).

    n

    the number of elements to drop

    returns

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

    Definition Classes
    ObservableLike
  54. def dropUntil(trigger: Observable[Any]): Observable[T]

    Discard items emitted by the source until a second observable emits an item or completes.

    Discard items emitted by the source until a second observable emits an item or completes.

    If the trigger observable completes in error, then the resulting observable will also end in error when it notices it (next time an element is emitted by the source).

    trigger

    the observable that has to emit an item before the source begin to be mirrored by the resulting observable

    Definition Classes
    ObservableLike
  55. 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.

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

    Definition Classes
    ObservableLike
  56. 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.

    Definition Classes
    ObservableLike
  57. def dump(prefix: String, out: PrintStream = System.out): Observable[T]

    Utility that can be used for debugging purposes.

    Utility that can be used for debugging purposes.

    Definition Classes
    ObservableLike
  58. def echoOnce(timeout: FiniteDuration): Observable[T]

    Mirror the source observable as long as the source keeps emitting items, otherwise if timeout passes without the source emitting anything new then the observable will emit the last item.

    Mirror the source observable as long as the source keeps emitting items, otherwise if timeout passes without the source emitting anything new then the observable will emit the last item.

    This is the rough equivalent of:

    Observable.merge(source, source.debounce(period))

    Note: If the source Observable keeps emitting items more frequently than the length of the time window then the resulting observable will mirror the source exactly.

    timeout

    the window of silence that must pass in order for the observable to echo the last item

    Definition Classes
    ObservableLike
  59. def echoRepeated(timeout: FiniteDuration): Observable[T]

    Mirror the source observable as long as the source keeps emitting items, otherwise if timeout passes without the source emitting anything new then the observable will start emitting the last item repeatedly.

    Mirror the source observable as long as the source keeps emitting items, otherwise if timeout passes without the source emitting anything new then the observable will start emitting the last item repeatedly.

    Note: If the source Observable keeps emitting items more frequently than the length of the time window then the resulting observable will mirror the source exactly.

    timeout

    the window of silence that must pass in order for the observable to start echoing the last item

    Definition Classes
    ObservableLike
  60. def endWith[B >: T](elems: Seq[B]): Observable[B]

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

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

    Definition Classes
    ObservableLike
  61. 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

    Definition Classes
    ObservableLike
  62. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  64. def existsF(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

    is 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

    Definition Classes
    ObservableLike
  65. def failed: Observable[Throwable]

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

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

    Definition Classes
    ObservableLike
  66. def filter(p: (T) ⇒ Boolean): Observable[T]

    Only emits those items for which the given predicate holds.

    Only emits those items for which the given predicate holds.

    p

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

    returns

    a new observable that emits only those items in the source for which the filter evaluates as true

    Definition Classes
    ObservableLike
  67. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  68. def findF(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

    is 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

    Definition Classes
    ObservableLike
  69. def firstOrElseF[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.

    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.

    Definition Classes
    ObservableLike
  70. def flatMap[B](f: (T) ⇒ Observable[B]): Observable[B]

    Applies a function that you supply to each item emitted by the source observable, where that function returns sequences that can be observed, and then concatenating those resulting sequences and emitting the results of this concatenation.

    Applies a function that you supply to each item emitted by the source observable, where that function returns sequences that can be observed, and then concatenating those resulting sequences and emitting the results of this concatenation.

    Alias for concatMap.

    The difference between the concat operation and mergeis that concat cares about the ordering of sequences (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.

    Definition Classes
    ObservableLike
  71. def flatMapDelayError[B](f: (T) ⇒ Observable[B]): Observable[B]

    Applies a function that you supply to each item emitted by the source observable, where that function returns sequences and then concatenating those resulting sequences and emitting the results of this concatenation.

    Applies a function that you supply to each item emitted by the source observable, where that function returns sequences and then concatenating those resulting sequences and emitting the results of this concatenation.

    It's an alias for 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.

    Definition Classes
    ObservableLike
  72. def flatMapLatest[B](f: (T) ⇒ Observable[B]): Observable[B]

    An alias of switchMap.

    An alias of switchMap.

    Returns a new observable that emits the items emitted by the observable most recently generated by the mapping function.

    Definition Classes
    ObservableLike
  73. def flatScan[R](initial: R)(op: (R, T) ⇒ Observable[R]): Observable[R]

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

    Definition Classes
    ObservableLike
  74. def flatScanDelayError[R](initial: R)(op: (R, T) ⇒ Observable[R]): Observable[R]

    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.

    This version of flatScan delays all errors until onComplete, when it will finally emit a CompositeException. It's the combination between scan and flatMapDelayError.

    Definition Classes
    ObservableLike
  75. def flatten[B](implicit ev: <:<[T, Observable[B]]): Observable[B]

    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 sequence by using this operator.

    The difference between the concat operation and mergeis that concat cares about the ordering of sequences (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.

    Alias for concat.

    returns

    an observable that emits items that are the result of flattening the items emitted by the observables emitted by the source

    Definition Classes
    ObservableLike
  76. def flattenDelayError[B](implicit ev: <:<[T, Observable[B]]): Observable[B]

    Alias for concatDelayError.

    Alias for concatDelayError.

    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 sequence by using this operator.

    The difference between the concat operation and mergeis that concat cares about the ordering of sequences (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. This version is reserving onError notifications until all of the observables complete and only then passing the issued errors(s) downstream. Note that the streamed error is a CompositeException, since multiple errors from multiple streams can happen.

    returns

    an observable that emits items that are the result of flattening the items emitted by the observables emitted by the source

    Definition Classes
    ObservableLike
  77. def flattenLatest[B](implicit ev: <:<[T, Observable[B]]): Observable[B]

    Alias for switch

    Alias for switch

    Convert an observable that emits observables into a single observable that emits the items emitted by the most-recently-emitted of those observables.

    Definition Classes
    ObservableLike
  78. def foldLeftF[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.

    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.

    Definition Classes
    ObservableLike
  79. def forAllF(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

    is 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

    Definition Classes
    ObservableLike
  80. def foreach(cb: (T) ⇒ Unit)(implicit s: Scheduler): Cancelable

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

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

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

    Definition Classes
    AnyRef → Any
  82. def groupBy[K](keySelector: (T) ⇒ K)(implicit keysBuffer: Synchronous[Nothing] = OverflowStrategy.Unbounded): Observable[GroupedObservable[K, T]]

    Groups the items emitted by an Observable according to a specified criterion, and emits these grouped items as GroupedObservables, one GroupedObservable per group.

    Groups the items emitted by an Observable according to a specified criterion, and emits these grouped items as GroupedObservables, one GroupedObservable per group.

    Note: A GroupedObservable will cache the items it is to emit until such time as it is subscribed to. For this reason, in order to avoid memory leaks, you should not simply ignore those GroupedObservables that do not concern you. Instead, you can signal to them that they may discard their buffers by doing something like source.take(0).

    keySelector

    a function that extracts the key for each item

    Definition Classes
    ObservableLike
  83. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  84. def headF: Observable[T]

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

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

    Definition Classes
    ObservableLike
  85. def headOrElseF[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.

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

    Definition Classes
    ObservableLike
  86. def ignoreElements: Observable[Nothing]

    Alias for completed.

    Alias for completed. Ignores all items emitted by the source and only calls onCompleted or onError.

    returns

    an empty sequence that only calls onCompleted or onError, based on which one is called by the source Observable

    Definition Classes
    ObservableLike
  87. def isEmptyF: Observable[Boolean]

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

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

    Definition Classes
    ObservableLike
  88. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  89. def lastF: Observable[T]

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

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

    Definition Classes
    ObservableLike
  90. def liftByOperator[B](operator: (Subscriber[B]) ⇒ Subscriber[T]): Observable[B]

    Transforms the source using the given operator.

    Transforms the source using the given operator.

    Definition Classes
    ObservableObservableLike
  91. def map[B](f: (T) ⇒ B): Observable[B]

    Returns a new observable that applies the given function to each item emitted by the source and emits the result.

    Returns a new observable that applies the given function to each item emitted by the source and emits the result.

    Definition Classes
    ObservableLike
  92. def materialize: Observable[Notification[T]]

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

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

    Definition Classes
    ObservableLike
  93. def maxByF[B](f: (T) ⇒ B)(implicit ev: Ordering[B]): 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.

    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.

    Definition Classes
    ObservableLike
  94. def maxF[B >: T](implicit ev: Ordering[B]): Observable[B]

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

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

    Definition Classes
    ObservableLike
  95. def merge[B](implicit ev: <:<[T, Observable[B]], os: OverflowStrategy[B] = OverflowStrategy.Default): Observable[B]

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

    returns

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

    Definition Classes
    ObservableLike
    Note

    this operation needs to do buffering and by not specifying an OverflowStrategy, the default strategy is being used.

  96. def mergeDelayErrors[B](implicit ev: <:<[T, Observable[B]], os: OverflowStrategy[B] = OverflowStrategy.Default): Observable[B]

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

    This version is reserving onError notifications until all of the observables complete and only then passing the issued errors(s) downstream. Note that the streamed error is a CompositeException, since multiple errors from multiple streams can happen.

    returns

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

    Definition Classes
    ObservableLike
    Note

    this operation needs to do buffering and by not specifying an OverflowStrategy, the default strategy is being used.

  97. def mergeMap[B](f: (T) ⇒ Observable[B])(implicit os: OverflowStrategy[B] = OverflowStrategy.Default): Observable[B]

    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 observable 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 observable and emitting the results of this merger.

    The difference between this and concatMap is that concatMap 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, the concat operation is safe to use in all contexts, whereas merge requires buffering.

    f

    - the transformation function

    returns

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

    Definition Classes
    ObservableLike
  98. def mergeMapDelayErrors[B](f: (T) ⇒ Observable[B])(implicit os: OverflowStrategy[B] = OverflowStrategy.Default): Observable[B]

    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 observable 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 observable and emitting the results of this merger.

    The difference between this and concatMap is that concatMap 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, the concat operation is safe to use in all contexts, whereas merge requires buffering.

    This version is reserving onError notifications until all of the observables complete and only then passing the issued errors(s) downstream. Note that the streamed error is a CompositeException, since multiple errors from multiple streams can happen.

    f

    - the transformation function

    returns

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

    Definition Classes
    ObservableLike
  99. def minByF[B](f: (T) ⇒ B)(implicit ev: Ordering[B]): 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.

    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.

    Definition Classes
    ObservableLike
  100. def minF[B >: T](implicit ev: Ordering[B]): Observable[B]

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

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

    Definition Classes
    ObservableLike
  101. def multicast[B >: T, R](pipe: Pipe[B, R])(implicit s: Scheduler): ConnectableObservable[R]

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

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

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

    Definition Classes
    AnyRef
  103. def nonEmptyF: Observable[Boolean]

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

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

    Definition Classes
    ObservableLike
  104. final def notify(): Unit

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

    Definition Classes
    AnyRef
  106. def onComplete(): Unit

    Definition Classes
    BehaviorSubjectObserver
  107. def onError(ex: Throwable): Unit

    Definition Classes
    BehaviorSubjectObserver
  108. def onErrorFallbackTo[B >: T](that: ⇒ Observable[B]): Observable[B]

    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

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

    Definition Classes
    ObservableLike
  109. def onErrorRecover[B >: T](pf: PartialFunction[Throwable, B]): Observable[B]

    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 fallbacks to an observable emitting a single element generated by the backup 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 fallbacks to an observable emitting a single element generated by the backup 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.

    pf

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

    Definition Classes
    ObservableLike
  110. def onErrorRecoverWith[B >: T](pf: PartialFunction[Throwable, Observable[B]]): Observable[B]

    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.

    pf

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

    Definition Classes
    ObservableLike
  111. def onErrorRetry(maxRetries: Long): Observable[T]

    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.

    Definition Classes
    ObservableLike
  112. def onErrorRetryIf(p: (Throwable) ⇒ Boolean): Observable[T]

    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.

    Definition Classes
    ObservableLike
  113. def onErrorRetryUnlimited: Observable[T]

    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.

    Definition Classes
    ObservableLike
  114. def onNext(elem: T): Future[Ack]

    Definition Classes
    BehaviorSubjectObserver
    Annotations
    @tailrec()
  115. def pipeThrough[I >: T, B](pipe: Pipe[I, B]): Observable[B]

    Given a Pipe, transform the source observable with it.

    Given a Pipe, transform the source observable with it.

    Definition Classes
    ObservableLike
  116. def publish(implicit s: Scheduler): ConnectableObservable[T]

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

    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.

    Definition Classes
    Observable
  117. def publishLast(implicit s: Scheduler): ConnectableObservable[T]

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

    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.

    Definition Classes
    Observable
  118. def reduce[B >: T](op: (B, B) ⇒ B): Observable[B]

    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.

    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.

    Definition Classes
    ObservableLike
  119. def repeat: Observable[T]

    Repeats the items emitted by the source continuously.

    Repeats the items emitted by the source continuously. It caches the generated items until onComplete and repeats them forever. On error it terminates.

    Definition Classes
    ObservableLike
  120. def replay(bufferSize: Int)(implicit s: Scheduler): ConnectableObservable[T]

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

    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.

    bufferSize

    is the size of the buffer limiting the number of items that can be replayed (on overflow the head starts being dropped)

    Definition Classes
    Observable
  121. def replay(implicit s: Scheduler): ConnectableObservable[T]

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

    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.

    Definition Classes
    Observable
  122. def sample(period: FiniteDuration): Observable[T]

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

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

    Use the sample operator 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.

    period

    the timespan at which sampling occurs

    Definition Classes
    ObservableLike
    See also

    sampleRepeated for repeating the last value on silence

    sampleBy for fine control

  123. def sampleBy[B](sampler: Observable[B]): Observable[T]

    Returns an observable that, when the specified sampler emits an item or completes, emits the most recently emitted item (if any) emitted by the source since the previous emission from the sampler.

    Returns an observable that, when the specified sampler emits an item or completes, emits the most recently emitted item (if any) emitted by the source since the previous emission from the sampler.

    Use the sampleBy operator 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 sampleBy operator will emit no item.

    sampler

    - the observable to use for sampling the source

    Definition Classes
    ObservableLike
    See also

    sampleRepeatedBy for repeating the last value on silence

    sample for periodic sampling

  124. def sampleRepeated(period: FiniteDuration): 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. If no new value has been emitted since the last time it was sampled, it signals the last emitted value anyway.

    period

    the timespan at which sampling occurs

    Definition Classes
    ObservableLike
    See also

    sampleRepeatedBy for fine control

    sample for a variant that doesn't repeat the last value on silence

  125. def sampleRepeatedBy[B](sampler: Observable[B]): Observable[T]

    Returns an observable that, when the specified sampler observable emits an item or completes, emits the most recently emitted item (if any) emitted by the source Observable since the previous emission from the sampler observable.

    Returns an observable that, when the specified sampler observable emits an item or completes, emits the most recently emitted item (if any) emitted by the source Observable since the previous emission from the sampler observable. If no new value has been emitted since the last time it was sampled, it signals the last emitted value anyway.

    sampler

    - the Observable to use for sampling the source Observable

    Definition Classes
    ObservableLike
    See also

    sampleRepeated for a periodic sampling

    sampleBy for a variant that doesn't repeat the last value on silence

  126. def scan[R](initial: R)(f: (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 foldLeftF, but emits the state on each step. Useful for modeling finite state machines.

    Definition Classes
    ObservableLike
  127. def share(implicit s: Scheduler): Observable[T]

    Returns a new Observable that multi-casts (shares) the original Observable.

    Returns a new Observable that multi-casts (shares) the original Observable.

    Definition Classes
    Observable
  128. def startWith[B >: T](elems: Seq[B]): Observable[B]

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

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

    Definition Classes
    ObservableLike
  129. def subscribe(nextFn: (T) ⇒ Future[Ack])(implicit s: Scheduler): Cancelable

    Subscribes to the stream.

    Subscribes to the stream.

    returns

    a subscription that can be used to cancel the streaming.

    Definition Classes
    Observable
  130. def subscribe()(implicit s: Scheduler): Cancelable

    Subscribes to the stream.

    Subscribes to the stream.

    returns

    a subscription that can be used to cancel the streaming.

    Definition Classes
    Observable
  131. def subscribe(nextFn: (T) ⇒ Future[Ack], errorFn: (Throwable) ⇒ Unit)(implicit s: Scheduler): Cancelable

    Subscribes to the stream.

    Subscribes to the stream.

    returns

    a subscription that can be used to cancel the streaming.

    Definition Classes
    Observable
  132. def subscribe(nextFn: (T) ⇒ Future[Ack], errorFn: (Throwable) ⇒ Unit, completedFn: () ⇒ Unit)(implicit s: Scheduler): Cancelable

    Subscribes to the stream.

    Subscribes to the stream.

    returns

    a subscription that can be used to cancel the streaming.

    Definition Classes
    Observable
  133. def subscribe(observer: Observer[T])(implicit s: Scheduler): Cancelable

    Subscribes to the stream.

    Subscribes to the stream.

    returns

    a subscription that can be used to cancel the streaming.

    Definition Classes
    Observable
  134. def subscribe(subscriber: Subscriber[T]): Cancelable

    Subscribes to the stream.

    Subscribes to the stream.

    returns

    a subscription that can be used to cancel the streaming.

    Definition Classes
    Observable
  135. def subscribeOn(scheduler: Scheduler): Observable[T]

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

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

    Definition Classes
    ObservableLike
  136. def sumF[B >: T](implicit arg0: Numeric[B]): Observable[B]

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

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

    Definition Classes
    ObservableLike
  137. def switch[B](implicit ev: <:<[T, Observable[B]]): Observable[B]

    Convert an observable that emits observables into a single observable that emits the items emitted by the most-recently-emitted of those observables.

    Convert an observable that emits observables into a single observable that emits the items emitted by the most-recently-emitted of those observables.

    Definition Classes
    ObservableLike
  138. def switchMap[B](f: (T) ⇒ Observable[B]): Observable[B]

    Returns a new observable that emits the items emitted by the observable most recently generated by the mapping function.

    Returns a new observable that emits the items emitted by the observable most recently generated by the mapping function.

    Definition Classes
    ObservableLike
  139. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

    Definition Classes
    ObservableLike
  141. def take(n: Long): 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

    Definition Classes
    ObservableLike
  142. def takeByTimespan(timespan: FiniteDuration): 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

    Definition Classes
    ObservableLike
  143. def takeLast(n: Int): Observable[T]

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

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

    In case the source triggers an error, then the underlying buffer gets dropped and the error gets emitted immediately.

    Definition Classes
    ObservableLike
  144. 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.

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

    Definition Classes
    ObservableLike
  145. def takeWhileNotCanceled(c: BooleanCancelable): Observable[T]

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

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

    Definition Classes
    ObservableLike
  146. def throttleFirst(interval: FiniteDuration): Observable[T]

    Returns an Observable that emits only the first item emitted by the source Observable during sequential time windows of a specified duration.

    Returns an Observable that emits only the first item emitted by the source Observable during sequential time windows of a specified duration.

    This differs from Observable!.throttleLast in that this only tracks passage of time whereas throttleLast ticks at scheduled intervals.

    interval

    time to wait before emitting another item after emitting the last item

    Definition Classes
    ObservableLike
  147. def throttleLast(period: FiniteDuration): Observable[T]

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

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

    Alias for sample.

    period

    duration of windows within which the last item emitted by the source Observable will be emitted

    Definition Classes
    ObservableLike
  148. def throttleWithTimeout(timeout: FiniteDuration): Observable[T]

    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.

    Alias for debounce.

    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

    Definition Classes
    ObservableLike
    See also

    echoOnce for a similar operator that also mirrors the source observable

  149. def timeoutOnSlowDownstream(timeout: FiniteDuration): Observable[T]

    Returns an observable that mirrors the source but that will trigger a DownstreamTimeoutException in case the downstream subscriber takes more than the given timespan to process an onNext message.

    Returns an observable that mirrors the source but that will trigger a DownstreamTimeoutException in case the downstream subscriber takes more than the given timespan to process an onNext message.

    Note that this ignores the time it takes for the upstream to send onNext messages. For detecting slow producers see timeoutOnSlowUpstream.

    timeout

    maximum duration for onNext.

    Definition Classes
    ObservableLike
  150. def timeoutOnSlowUpstream(timeout: FiniteDuration): Observable[T]

    Returns an observable that mirrors the source but applies a timeout for each emitted item by the upstream.

    Returns an observable that mirrors the source but applies a timeout for each emitted item by the upstream. If the next item isn't emitted within the specified timeout duration starting from its predecessor, the resulting Observable terminates and notifies observers of a TimeoutException.

    Note that this ignores the time it takes to process onNext. If dealing with a slow consumer, see timeoutOnSlowDownstream.

    timeout

    maximum duration between emitted items before a timeout occurs (ignoring the time it takes to process onNext)

    Definition Classes
    ObservableLike
  151. def timeoutOnSlowUpstreamTo[B >: T](timeout: FiniteDuration, backup: ⇒ Observable[B]): Observable[B]

    Returns an observable that mirrors the source but applies a timeout for each emitted item by the upstream.

    Returns an observable that mirrors the source but applies a timeout for each emitted item by the upstream. If the next item isn't emitted within the specified timeout duration starting from its predecessor, the source is terminated and the downstream gets subscribed to the given backup.

    Note that this ignores the time it takes to process onNext. If dealing with a slow consumer, see timeoutOnSlowDownstream.

    timeout

    maximum duration between emitted items before a timeout occurs (ignoring the time it takes to process onNext)

    backup

    is the alternative data source to subscribe to on timeout

    Definition Classes
    ObservableLike
  152. def toReactive[U >: T](bufferSize: Int)(implicit s: Scheduler): Processor[T, U]

    Definition Classes
    Subject
  153. def toReactive[U >: T](implicit s: Scheduler): Processor[T, U]

    Wraps this Observable into a org.reactivestreams.Publisher.

    Wraps this Observable into a org.reactivestreams.Publisher. See the Reactive Streams protocol that Monix implements.

    Definition Classes
    SubjectObservable
  154. def toString(): String

    Definition Classes
    AnyRef → Any
  155. def transform[B](transformer: (Observable[T]) ⇒ Observable[B]): Observable[B]

    Transforms the source using the given transformer function.

    Transforms the source using the given transformer function.

    Definition Classes
    ObservableObservableLike
  156. def unsafeMulticast[B >: T, R](processor: Subject[B, R])(implicit s: Scheduler): ConnectableObservable[R]

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

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

    This operator is unsafe because Subject objects are stateful and have to obey the Observer contract, meaning that they shouldn't be subscribed multiple times, so they are error prone. Only use if you know what you're doing, otherwise prefer the safe multicast operator.

    Definition Classes
    Observable
  157. def unsafeSubscribeFn(subscriber: Subscriber[T]): Cancelable

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

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

    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.

    Definition Classes
    BehaviorSubjectObservable
    Annotations
    @tailrec()
    See also

    subscribe.

  158. def unsafeSubscribeFn(observer: Observer[T])(implicit s: Scheduler): Cancelable

    Definition Classes
    Observable
  159. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  162. def whileBusyBuffer[B >: T](overflowStrategy: Synchronous[B]): Observable[B]

    While the destination observer is busy, buffers events, applying the given overflowStrategy.

    While the destination observer is busy, buffers events, applying the given overflowStrategy.

    overflowStrategy

    - the overflow strategy used for buffering, which specifies what to do in case we're dealing with a slow consumer - should an unbounded buffer be used, should back-pressure be applied, should the pipeline drop newer or older events, should it drop the whole buffer? See OverflowStrategy for more details.

    Definition Classes
    ObservableLike
  163. def whileBusyDropEvents: Observable[T]

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

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

    Definition Classes
    ObservableLike
  164. def whileBusyDropEventsAndSignal[B >: T](onOverflow: (Long) ⇒ B): Observable[B]

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

    While the destination observer is busy, drop the incoming events. When the downstream recovers, we can signal a special event meant to inform the downstream observer how many events where dropped.

    onOverflow

    - a function that is used for signaling a special event used to inform the consumers that an overflow event happened, function that receives the number of dropped events as a parameter (see OverflowStrategy.Evicted)

    Definition Classes
    ObservableLike
  165. def zip[B](other: Observable[B]): Observable[(T, B)]

    Creates a new observable from this observable and another given observable by combining their items in pairs in a strict sequence.

    Creates a new observable from this observable and another given observable by combining their items in pairs in a strict sequence.

    So the first item emitted by the new observable will be the tuple of the first items emitted by each of the source observables; the second item emitted by the new observable will be a tuple with the second items emitted by each of those observables; and so forth.

    See combineLatest for a more relaxed alternative that doesn't combine items in strict sequence.

    other

    is an observable that gets paired with the source

    returns

    a new observable sequence that emits the paired items of the source observables

    Definition Classes
    ObservableLike
  166. def zipWith[B, R](other: Observable[B])(f: (T, B) ⇒ R): Observable[R]

    Creates a new observable from this observable and another given observable by combining their items in pairs in a strict sequence.

    Creates a new observable from this observable and another given observable by combining their items in pairs in a strict sequence.

    So the first item emitted by the new observable will be the result of the function applied to the first item emitted by each of the source observables; the second item emitted by the new observable will be the result of the function applied to the second item emitted by each of those observables; and so forth.

    See combineLatestWith for a more relaxed alternative that doesn't combine items in strict sequence.

    other

    is an observable that gets paired with the source

    f

    is a mapping function over the generated pairs

    Definition Classes
    ObservableLike
  167. def zipWithIndex: Observable[(T, Long)]

    Zips the emitted elements of the source with their indices.

    Zips the emitted elements of the source with their indices.

    Definition Classes
    ObservableLike

Inherited from Subject[T, T]

Inherited from Observer[T]

Inherited from Observable[T]

Inherited from ObservableLike[T, Observable]

Inherited from AnyRef

Inherited from Any

Ungrouped