monifu.reactive

Observable

object Observable

Linear Supertypes
AnyRef, Any
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

Value Members

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

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

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

    Definition Classes
    AnyRef → Any
  4. implicit def FutureIsObservable[T](future: Future[T])(implicit ec: ExecutionContext): Observable[T]

    Implicit conversion from Future to Observable.

  5. implicit def ObservableIsPublisher[T](source: Observable[T]): Publisher[T]

    Implicit conversion from Observable to Publisher.

  6. def amb[T](source: Observable[T]*)(implicit ec: ExecutionContext): Observable[T]

    Given a list of source Observables, emits all of the items from the first of these Observables to emit an item and cancel the rest.

  7. def apply[T](elems: T*)(implicit ec: ExecutionContext): Observable[T]

    Creates an Observable that emits the given elements.

    Creates an Observable that emits the given elements.

    Usage sample:

    val obs = Observable(1, 2, 3, 4)
    
    obs.dump("MyObservable").subscribe()
    //=> 0: MyObservable-->1
    //=> 1: MyObservable-->2
    //=> 2: MyObservable-->3
    //=> 3: MyObservable-->4
    //=> 4: MyObservable completed
  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def concat[T](sources: Observable[T]*)(implicit ec: ExecutionContext): Observable[T]

    Concatenates the given list of observables into a single observable.

  11. def create[T](f: (Observer[T]) ⇒ Unit)(implicit ec: ExecutionContext): Observable[T]

    Observable constructor for creating an Observable from the specified function.

    Observable constructor for creating an Observable from the specified function.

    Example:

    import monifu.reactive._
    import monifu.reactive.Ack.Continue
    import concurrent.ExecutionContext
    
    def emit[T](elem: T, nrOfTimes: Int)(implicit ec: ExecutionContext): Observable[T] =
      Observable.create { observer =>
        def loop(times: Int): Unit =
          ec.execute(new Runnable {
            def run() = {
              if (times > 0)
                observer.onNext(elem).onSuccess {
                  case Continue => loop(times - 1)
                }
              else
                observer.onComplete()
            }
          })
    
        loop(nrOfTimes)
      }
    
    // usage sample
    import concurrent.ExecutionContext.Implicits.global
    
    emit(elem=30, nrOfTimes=3).dump("Emit").subscribe()
    //=> 0: Emit-->30
    //=> 1: Emit-->30
    //=> 2: Emit-->30
    //=> 3: Emit completed
  12. def empty[A](implicit ec: ExecutionContext): Observable[A]

    Creates an observable that doesn't emit anything, but immediately calls onComplete instead.

    Creates an observable that doesn't emit anything, but immediately calls onComplete instead.

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

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

    Definition Classes
    AnyRef → Any
  15. def error(ex: Throwable)(implicit ec: ExecutionContext): Observable[Nothing]

    Creates an Observable that emits an error.

    Creates an Observable that emits an error.

  16. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. def flatten[T](sources: Observable[T]*)(implicit ec: ExecutionContext): Observable[T]

    Concatenates the given list of observables into a single observable.

  18. def from[T](iterable: Iterable[T])(implicit ec: ExecutionContext): Observable[T]

    Creates an Observable that emits the elements of the given iterable.

    Creates an Observable that emits the elements of the given iterable.

  19. def from[T](future: Future[T])(implicit ec: ExecutionContext): Observable[T]

    Converts a Future to an Observable.

    Converts a Future to an Observable.

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

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

    Definition Classes
    AnyRef → Any
  22. def interval(period: FiniteDuration)(implicit ec: ExecutionContext, s: Scheduler): Observable[Long]

    Creates an Observable that emits auto-incremented natural numbers (longs) spaced by a given time interval.

    Creates an Observable that emits auto-incremented natural numbers (longs) spaced by a given time interval. Starts from 0 with no delay, after which it emits incremented numbers spaced by the period of time.

    period

    the delay between two subsequent events

    ec

    the execution context in which onNext will get called

    s

    the scheduler used for scheduling the periodic signaling of onNext

  23. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  24. def merge[T](sources: Observable[T]*)(implicit ec: ExecutionContext): Observable[T]

    Merges the given list of observables into a single observable.

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

    Definition Classes
    AnyRef
  26. def never(implicit ec: ExecutionContext): Observable[Nothing]

    Creates an Observable that doesn't emit anything and that never completes.

    Creates an Observable that doesn't emit anything and that never completes.

  27. final def notify(): Unit

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

    Definition Classes
    AnyRef
  29. def range(from: Int, until: Int, step: Int = 1)(implicit ec: ExecutionContext): Observable[Int]

    Creates an Observable that emits items in the given range.

    Creates an Observable that emits items in the given range.

    from

    the range start

    until

    the range end

    step

    increment step, either positive or negative

  30. def repeat[T](elems: T*)(implicit ec: ExecutionContext): Observable[T]

    Creates an Observable that continuously emits the given item repeatedly.

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

    Definition Classes
    AnyRef
  32. def timer[T](initialDelay: FiniteDuration, period: FiniteDuration, unit: T)(implicit ec: ExecutionContext, s: Scheduler): Observable[T]

    Create an Observable that repeatedly emits the given item, until the underlying Observer cancels.

  33. def timer[T](delay: FiniteDuration, unit: T)(implicit ec: ExecutionContext, s: Scheduler): Observable[T]

    Create an Observable that emits a single item after a given delay.

  34. def toString(): String

    Definition Classes
    AnyRef → Any
  35. def unit[A](elem: A)(implicit ec: ExecutionContext): Observable[A]

    Creates an Observable that only emits the given a

    Creates an Observable that only emits the given a

  36. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. def zip[T1, T2, T3, T4](obs1: Observable[T1], obs2: Observable[T2], obs3: Observable[T3], obs4: Observable[T4]): Observable[(T1, T2, T3, T4)]

    Creates a new Observable from three observables, by emitting elements combined in tuples of 4 elements.

    Creates a new Observable from three observables, by emitting elements combined in tuples of 4 elements. If one of the Observable emits fewer events than the others, then the rest of the unpaired events are ignored.

  40. def zip[T1, T2, T3](obs1: Observable[T1], obs2: Observable[T2], obs3: Observable[T3]): Observable[(T1, T2, T3)]

    Creates a new Observable from three observables, by emitting elements combined in tuples of 3 elements.

    Creates a new Observable from three observables, by emitting elements combined in tuples of 3 elements. If one of the Observable emits fewer events than the others, then the rest of the unpaired events are ignored.

  41. def zip[T1, T2](obs1: Observable[T1], obs2: Observable[T2]): Observable[(T1, T2)]

    Creates a new Observable from two observables, by emitting elements combined in pairs.

    Creates a new Observable from two observables, 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