Rxn

dev.tauri.choam.core.Rxn
See theRxn companion object
sealed abstract class Rxn[-A, +B]

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 Rxns 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].

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

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

Concrete methods

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 >>[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 attempt: Rxn[A, Option[B]]
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 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 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 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 toFunction: A => Axn[B]
final def unsafePerform(a: A, mcas: Mcas, maxBackoff: Int, randomizeBackoff: Boolean, maxRetries: Option[Int]): 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.

Value parameters

a

the input to the Rxn.

maxBackoff

the maximal amount to spin when backing off (before retries).

maxRetries

the maximum number of retries (pass None for possibly infinite retries).

mcas

the mcas.Mcas implementation to use.

randomizeBackoff

whether to do exponential backoff *with* randomization.

Attributes

Returns

the result of the executed Rxn.

final def void: Rxn[A, Unit]
final def ×[C, D](that: Rxn[C, D]): Rxn[(A, C), (B, D)]