RxOption

wvlet.airframe.rx.RxOption
trait RxOption[+A] extends RxOps[Option[A]]

Attributes

Graph
Supertypes
trait RxOps[Option[A]]
class Object
trait Matchable
class Any
Known subtypes
trait RxOptionCache[A]
class RxOptionCacheOp[A]
class RxOptionOp[A]
class RxOptionVar[A]

Members list

Value members

Abstract methods

protected def in: Rx[Option[A]]

Concrete methods

def cache[A1 >: A]: RxOptionCache[A1]
def filter(f: A => Boolean): RxOption[A]
def flatMap[B](f: A => RxOps[B]): RxOption[B]
def getOrElse[A1 >: A](default: => A1): Rx[A1]
def getOrElseRx[A1 >: A](default: => RxOps[A1]): Rx[A1]
def join[B](b: RxOps[B]): Rx[(Option[A], B)]
def join[B, C](b: RxOps[B], c: RxOps[C]): Rx[(Option[A], B, C)]
def join[B, C, D](b: RxOps[B], c: RxOps[C], d: RxOps[D]): Rx[(Option[A], B, C, D)]
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)]
def map[B](f: A => B): RxOption[B]
def orElse[A1 >: A](default: => Option[A1]): RxOption[A1]
def toRx: Rx[Option[A]]
def transform[B](f: Option[A] => B): Rx[B]
def transformOption[B](f: Option[A] => Option[B]): RxOption[B]
def transformRx[B](f: Option[A] => RxOps[B]): Rx[B]
def transformRxOption[B](f: Option[A] => RxOption[B]): RxOption[B]
def when(cond: A => Boolean): RxOption[A]

An alias for filter

An alias for filter

Attributes

def withFilter(f: A => Boolean): RxOption[A]
def zip[B](b: RxOps[B]): Rx[(Option[A], B)]
def zip[B, C](b: RxOps[B], c: RxOps[C]): Rx[(Option[A], B, C)]
def zip[B, C, D](b: RxOps[B], c: RxOps[C], d: RxOps[D]): Rx[(Option[A], B, C, D)]
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)]

Inherited methods

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 parents: Seq[RxOps[_]]

Attributes

Inherited from:
RxOps
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 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