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: AnyRef): Boolean

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

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

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

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

    Definition Classes
    Any
  6. implicit def FutureIsObservable[T](future: Future[T])(implicit scheduler: Scheduler): Observable[T]

    Implicit conversion from Future to Observable.

  7. def apply[T](elems: T*)(implicit scheduler: Scheduler): 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 scheduler: Scheduler): Observable[T]

    Concatenates the given list of observables into a single observable.

  11. def create[T](f: (Observer[T]) ⇒ Unit)(implicit scheduler: Scheduler): 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.api.Ack.Continue
    import monifu.concurrent.Scheduler
    
    def emit[T](elem: T, nrOfTimes: Int)(implicit scheduler: Scheduler): Observable[T] =
      Observable.create { observer =>
        def loop(times: Int): Unit =
          scheduler.scheduleOnce {
            if (times > 0)
              observer.onNext(elem).onSuccess {
                case Continue => loop(times - 1)
              }
            else
              observer.onComplete()
          }
        loop(nrOfTimes)
      }
    
    // usage sample
    import monifu.concurrent.Scheduler.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 scheduler: Scheduler): 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 scheduler: Scheduler): 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 scheduler: Scheduler): Observable[T]

    Concatenates the given list of observables into a single observable.

  18. def from[T](iterable: Iterable[T])(implicit scheduler: Scheduler): 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 scheduler: Scheduler): 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 scheduler: 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

    scheduler

    the execution context in which onNext will get called

  23. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  24. def merge[T](sources: Observable[T]*)(implicit scheduler: Scheduler): 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 scheduler: Scheduler): 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 scheduler: Scheduler): 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 scheduler: Scheduler): 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 toString(): String

    Definition Classes
    AnyRef → Any
  33. def unit[A](elem: A)(implicit scheduler: Scheduler): Observable[A]

    Creates an Observable that only emits the given a

    Creates an Observable that only emits the given a

  34. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. 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.

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

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