RxOptionVar

wvlet.airframe.rx.RxOptionVar
class RxOptionVar[A](variable: RxVar[Option[A]]) extends RxOption[A], RxVarOps[Option[A]]

RxVar implementation for Option[A] type values

Attributes

Graph
Supertypes
trait RxVarOps[Option[A]]
trait RxOption[A]
trait RxOps[Option[A]]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def foreach[U](f: Option[A] => U): Cancelable

Attributes

Definition Classes
override def foreachEvent[U](effect: RxEvent => U): Cancelable

Attributes

Definition Classes
override def get: Option[A]

Attributes

Definition Classes
override def parents: Seq[RxOps[_]]

Attributes

Definition Classes
override def setException(e: Throwable): Unit

Propagate an error to the subscribers

Propagate an error to the subscribers

Attributes

Definition Classes
override def stop(): Unit

Stop updating this variable and send OnCompletion event to the downstream subscribers. After this method is called, the behavior of the downstream subscribers is undefined for further updates of this variable.

Stop updating this variable and send OnCompletion event to the downstream subscribers. After this method is called, the behavior of the downstream subscribers is undefined for further updates of this variable.

Attributes

Definition Classes
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any
override def update(updater: Option[A] => Option[A], force: Boolean): Unit

Updates the variable and trigger the recalculation of the subscribers currentValue => newValue

Updates the variable and trigger the recalculation of the subscribers currentValue => newValue

Attributes

Definition Classes

Inherited methods

def :=(newValue: Option[A]): Unit

Attributes

Inherited from:
RxVarOps
def await: A

Await the completion of the first Rx result. This method is available only in Scala JVM.

Await the completion of the first Rx result. This method is available only in Scala JVM.

Note: Generally speaking, blocking operations should be avoided in reactive programming. Use this method only for testing purpose. Both airframe-http and AirSpec supports evaluating Rx[X] result (async) in a non-blocking way.

Attributes

Returns

the result

Inherited from:
RxOps
def cache[A1 >: A]: RxOptionCache[A1]

Attributes

Inherited from:
RxOption
def filter(f: A => Boolean): RxOption[A]

Attributes

Inherited from:
RxOption
def flatMap[B](f: A => RxOps[B]): RxOption[B]

Attributes

Inherited from:
RxOption
def forceSet(newValue: Option[A]): Unit

Attributes

Inherited from:
RxVarOps
def forceUpdate(updater: Option[A] => Option[A]): Unit

Update the variable and force notification to subscribers

Update the variable and force notification to subscribers

Attributes

Inherited from:
RxVarOps
def getOrElse[A1 >: A](default: => A1): Rx[A1]

Attributes

Inherited from:
RxOption
def getOrElseRx[A1 >: A](default: => RxOps[A1]): Rx[A1]

Attributes

Inherited from:
RxOption
def join[B, C, D, E](b: RxOps[B], c: RxOps[C], d: RxOps[D], e: RxOps[E]): Rx[(Option[A], B, C, D, E)]

Attributes

Inherited from:
RxOption
def join[B, C, D](b: RxOps[B], c: RxOps[C], d: RxOps[D]): Rx[(Option[A], B, C, D)]

Attributes

Inherited from:
RxOption
def join[B, C](b: RxOps[B], c: RxOps[C]): Rx[(Option[A], B, C)]

Attributes

Inherited from:
RxOption
def join[B](b: RxOps[B]): Rx[(Option[A], B)]

Attributes

Inherited from:
RxOption
def map[B](f: A => B): RxOption[B]

Attributes

Inherited from:
RxOption
def orElse[A1 >: A](default: => Option[A1]): RxOption[A1]

Attributes

Inherited from:
RxOption
def recover[U](f: PartialFunction[Throwable, U]): Rx[U]

Recover from a known error and emit a replacement value

Recover from a known error and emit a replacement value

Attributes

Inherited from:
RxOps
def recoverWith[A](f: PartialFunction[Throwable, RxOps[A]]): Rx[A]

Recover from a known error and emit replacement values from a given Rx

Recover from a known error and emit replacement values from a given Rx

Attributes

Inherited from:
RxOps
def run[U](effect: Option[A] => U): Cancelable

Evaluate this Rx[A] and apply the given effect function. Once OnError(e) or OnCompletion is observed, it will stop the evaluation.

Evaluate this Rx[A] and apply the given effect function. Once OnError(e) or OnCompletion is observed, it will stop the evaluation.

Attributes

Inherited from:
RxOps
def runContinuously[U](effect: Option[A] => U): Cancelable

Keep evaluating Rx[A] even if OnError(e) or OnCompletion is reported. This is useful for keep processing streams.

Keep evaluating Rx[A] even if OnError(e) or OnCompletion is reported. This is useful for keep processing streams.

Attributes

Inherited from:
RxOps
def set(newValue: Option[A]): Unit

Attributes

Inherited from:
RxVarOps
def subscribe[U](subscriber: Option[A] => U): Cancelable

Attributes

Inherited from:
RxOps
def tap(f: Option[A] => Unit): Rx[A]

Applies f to the value for having a side effect, and return the original value.

Applies f to the value for having a side effect, and return the original value.

The difference from tapOn is that this method will not receive an input failure.

Value parameters

f

side-effect function used when observing a value

Attributes

Returns

the original Rx event

Inherited from:
RxOps
def tapOn(f: PartialFunction[Try[Option[A]], Unit]): Rx[A]

Applies f to the value for having a side effect, and return the original value.

Applies f to the value for having a side effect, and return the original value.

This method is useful for debugging Rx chains. For example:

 rx.tapOn {
   case Success(v) => debug(s"received ${v}")
   case Failure(e) => error(s"request failed", e)
 }

Value parameters

f

partial function for the side effect

Attributes

Returns

the original Rx event

Inherited from:
RxOps
def tapOnFailure(f: Throwable => Unit): Rx[A]

Applies f to the error if it happens, and return the original value.

Applies f to the error if it happens, and return the original value.

This method is useful for logging the error.

Value parameters

f

side-effect function used when observing an error

Attributes

Returns

the original Rx event

Inherited from:
RxOps
def toRx: Rx[Option[A]]

Attributes

Inherited from:
RxOption
def transform[B](f: Option[A] => B): Rx[B]

Attributes

Inherited from:
RxOption
def transformOption[B](f: Option[A] => Option[B]): RxOption[B]

Attributes

Inherited from:
RxOption
def transformRx[B](f: Option[A] => RxOps[B]): Rx[B]

Attributes

Inherited from:
RxOption
def transformRxOption[B](f: Option[A] => RxOption[B]): RxOption[B]

Attributes

Inherited from:
RxOption
def when(cond: A => Boolean): RxOption[A]

An alias for filter

An alias for filter

Attributes

Inherited from:
RxOption
def withFilter(f: A => Boolean): RxOption[A]

Attributes

Inherited from:
RxOption
def zip[B, C, D, E](b: RxOps[B], c: RxOps[C], d: RxOps[D], e: RxOps[E]): Rx[(Option[A], B, C, D, E)]

Attributes

Inherited from:
RxOption
def zip[B, C, D](b: RxOps[B], c: RxOps[C], d: RxOps[D]): Rx[(Option[A], B, C, D)]

Attributes

Inherited from:
RxOption
def zip[B, C](b: RxOps[B], c: RxOps[C]): Rx[(Option[A], B, C)]

Attributes

Inherited from:
RxOption
def zip[B](b: RxOps[B]): Rx[(Option[A], B)]

Attributes

Inherited from:
RxOption