Packages

package subjects

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Type Members

  1. final class AsyncSubject[A] extends Subject[A, A]

    An AsyncSubject emits the last value (and only the last value) emitted by the source and only after the source completes.

    An AsyncSubject emits the last value (and only the last value) emitted by the source and only after the source completes.

    If the source terminates with an error, the AsyncSubject will not emit any items to subsequent subscribers, but will simply pass along the error notification from the source Observable.

  2. final class BehaviorSubject[A] extends Subject[A, A]

    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.

    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.

    See also

    Subject

  3. abstract class ConcurrentSubject[I, +O] extends Subject[I, O] with Sync[I]

    A concurrent subject is meant for imperative style feeding of events.

    A concurrent subject is meant for imperative style feeding of events.

    When emitting events, one doesn't need to follow the back-pressure contract. On the other hand the grammar must still be respected:

    (onNext)* (onComplete | onError)

  4. final class PublishSubject[A] extends Subject[A, A]

    A PublishSubject emits to a subscriber only those items that are emitted by the source subsequent to the time of the subscription.

    A PublishSubject emits to a subscriber only those items that are emitted by the source subsequent to the time of the subscription.

    If the source terminates with an error, the PublishSubject will not emit any items to subsequent subscribers, but will simply pass along the error notification from the source Observable.

    See also

    Subject

  5. final class PublishToOneSubject[A] extends Subject[A, A] with BooleanCancelable

    PublishToOneSubject is a monix.reactive.subjects.PublishSubject that can be subscribed at most once.

    PublishToOneSubject is a monix.reactive.subjects.PublishSubject that can be subscribed at most once.

    In case the subject gets subscribed more than once, then the subscribers will be notified with a APIContractViolationException error.

    Given that unicast observables are tricky, for working with this subject one can also be notified when the subscription finally happens.

  6. final class ReplaySubject[A] extends Subject[A, A]

    ReplaySubject emits to any observer all of the items that were emitted by the source, regardless of when the observer subscribes.

  7. abstract class Subject[I, +O] extends Observable[O] with Observer[I]

    A Subject is a sort of bridge or proxy that acts both as an Observer and as an Observable and that must respect the contract of both.

    A Subject is a sort of bridge or proxy that acts both as an Observer and as an Observable and that must respect the contract of both.

    Because it is a Observer, it can subscribe to an Observable and because it is an Observable, it can pass through the items it observes by re-emitting them and it can also emit new items.

    Useful to build multicast Observables or reusable processing pipelines.

  8. final class Var[A] extends Observable[A]

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

    Var when subscribed, will emit the most recently emitted item by the source, or the initial (as the seed) in case no value has yet been emitted, then continuing to emit events subsequent to the time of invocation via an underlying ConcurrentSubject. Note that this data type is equivalent to a ConcurrentSubject.behavior(Unbounded) with additional functionality to expose the current value for immediate usage.

    Sample usage:

    import monix.reactive._
    import monix.reactive.subjects.Var
    import monix.execution.Scheduler.Implicits.global
    
    val a = Var(0)
    val b = Var(0)
    
    // Sum that gets re-calculated "reactively"
    val sum = Observable.combineLatestMap2(a, b)(_ + _)
    
    // Subscribes for updates
    sum.dump("Sum").subscribe()
    
    a := 4
    // 0: Sum --> 4
    b := 5
    // 1: Sum --> 9
    a := 10
    // 0: Sum --> 15
    See also

    ConcurrentSubject

Value Members

  1. object AsyncSubject extends Serializable
  2. object BehaviorSubject extends Serializable
  3. object ConcurrentSubject extends Serializable
  4. object PublishSubject extends Serializable
  5. object PublishToOneSubject extends Serializable
  6. object ReplaySubject extends Serializable
  7. object Subject extends Serializable
  8. object Var extends Serializable

Ungrouped