ai.entrolution.bengal.stm.model

Core model types for Bengal STM.

Attributes

Members list

Type members

Classlikes

object TxnErratum

Attributes

Source
TxnErratum.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
TxnErratum.type
case class TxnVar[F[_], T](id: TxnVarId, value: Ref[F, T], commitLock: Semaphore[F])

A mutable transactional variable holding a single value of type T.

A mutable transactional variable holding a single value of type T.

TxnVar instances are created outside the Txn monad via TxnVar.of and then read/written within transactions using the syntax extensions provided by the STM implicit class or bengal.stm.syntax.all._.

Type parameters

F

the effect type

T

the value type

Attributes

Companion
object
Source
TxnVar.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object TxnVar

Attributes

Companion
class
Source
TxnVar.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
TxnVar.type
case class TxnVarMap[F[_], K, V](id: TxnVarId, value: Ref[F, VarIndex[F, K, V]], commitLock: Semaphore[F], internalStructureLock: Semaphore[F])(implicit evidence$1: STM[F], evidence$2: Async[F])

A mutable transactional map from keys of type K to values of type V.

A mutable transactional map from keys of type K to values of type V.

Unlike wrapping a Map in a TxnVar, TxnVarMap tracks individual keys as separate transactional entities, enabling finer-grained conflict detection and better concurrency. Create instances via TxnVarMap.of.

Type parameters

F

the effect type

K

the key type

V

the value type

Attributes

Companion
object
Source
TxnVarMap.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object TxnVarMap

Attributes

Companion
class
Source
TxnVarMap.scala
Supertypes
class Object
trait Matchable
class Any
Self type
TxnVarMap.type

Types

type Txn[V] = Free[TxnOrErr, V]

A composable transaction that produces a value of type V when committed.

A composable transaction that produces a value of type V when committed. Built using a free monad over the STM algebra, enabling static analysis of transaction variable domains before execution.

Attributes

Source
package.scala