sealed abstract class Rxn[-A, +B] extends AnyRef
An effectful function from A
to B
; when executed,
it may update any number of Refs atomically. (It
may also create new Refs.)
These functions are composable (see below), and composition preserves their atomicity. That is, all affected Refs will be updated atomically.
A Rxn forms an Arrow (more
specifically, an ArrowChoice).
It also forms a Monad in B
; however, consider
using the arrow combinators (when possible) instead of flatMap
(since a static combination of Rxn
s may be more performant).
The relation between Rxn and Axn is approximately
Rxn[A, B] ≡ (A => Axn[B])
; or, alternatively
Axn[A] ≡ Rxn[Any, A]
.
- Source
- Rxn.scala
- Alphabetic
- By Inheritance
- Rxn
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def *[X <: A, C](that: Rxn[X, C]): Rxn[X, (B, C)]
- final def *>[X <: A, C](that: Rxn[X, C]): Rxn[X, C]
- final def +[X <: A, Y >: B](that: Rxn[X, Y]): Rxn[X, Y]
- final def <*[X <: A, C](that: Rxn[X, C]): Rxn[X, B]
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def >>[X <: A, C](that: => Rxn[X, C]): Rxn[X, C]
- final def >>>[C](that: Rxn[B, C]): Rxn[A, C]
- final def ?: Rxn[A, Option[B]]
- final def as[C](c: C): Rxn[A, C]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- final def attempt: Rxn[A, Option[B]]
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def contramap[C](f: (C) => A): Rxn[C, B]
- final def dimap[C, D](f: (C) => A)(g: (B) => D): Rxn[C, D]
- final def dup: Rxn[A, (B, B)]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def first[C]: Rxn[(A, C), (B, C)]
- final def flatMap[X <: A, C](f: (B) => Rxn[X, C]): Rxn[X, C]
- final def flatMapF[C](f: (B) => Axn[C]): Rxn[A, C]
- final def flatTap(rxn: Rxn[B, Unit]): Rxn[A, B]
- final def flatten[C](implicit ev: <:<[B, Axn[C]]): Rxn[A, C]
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def map[C](f: (B) => C): Rxn[A, C]
- final def map2[X <: A, C, D](that: Rxn[X, C])(f: (B, C) => D): Rxn[X, D]
- final def maybe: Rxn[A, Boolean]
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def perform[F[_], X >: B](a: A, mcas: Mcas, strategy: RetryStrategy = RetryStrategy.Default)(implicit F: Async[F]): F[X]
- final def postCommit(pc: Rxn[B, Unit]): Rxn[A, B]
- final def productL[X <: A, C](that: Rxn[X, C]): Rxn[X, B]
- final def productR[X <: A, C](that: Rxn[X, C]): Rxn[X, C]
- final def provide(a: A): Axn[B]
- final def second[C]: Rxn[(C, A), (C, B)]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- final def toFunction: (A) => Axn[B]
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def unsafePerform(a: A, mcas: Mcas, strategy: Spin = RetryStrategy.Default): B
Execute the Rxn with the specified input
a
.Execute the Rxn with the specified input
a
.This method is
unsafe
because it performs side-effects.- a
the input to the Rxn.
- mcas
the internal.mcas.Mcas implementation to use.
- strategy
the retry strategy to use.
- returns
the result of the executed Rxn.
- final def void: Rxn[A, Unit]
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def ×[C, D](that: Rxn[C, D]): Rxn[(A, C), (B, D)]