TxnVarMapOps

ai.entrolution.bengal.stm.STM.TxnVarMapOps
implicit class TxnVarMapOps[K, V](txnVarMap: TxnVarMap[F, K, V])

Provides transaction operations on TxnVarMap instances. Automatically available when an STM[F] is implicit.

Attributes

Source
STM.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def get: Txn[Map[K, V]]

Retrieves an immutable snapshot of the entire map.

Retrieves an immutable snapshot of the entire map. Prefer per-key access for performance.

Attributes

Source
STM.scala
def get(key: => K): Txn[Option[V]]

Retrieves the value for a key, returning None if the key was deleted in this transaction.

Retrieves the value for a key, returning None if the key was deleted in this transaction.

Attributes

Source
STM.scala
def modify(f: (Map[K, V]) => Map[K, V]): Txn[Unit]

Modifies the entire map by applying a pure function.

Modifies the entire map by applying a pure function.

Attributes

Source
STM.scala
def modify(key: => K, f: V => V): Txn[Unit]

Modifies the value for a key by applying a pure function.

Modifies the value for a key by applying a pure function. Throws if the key is absent.

Attributes

Source
STM.scala
def remove(key: => K): Txn[Unit]

Removes a key-value pair from the map.

Removes a key-value pair from the map. Throws if the key is absent.

Attributes

Source
STM.scala
def set(newValueMap: => Map[K, V]): Txn[Unit]

Replaces the entire map state.

Replaces the entire map state. Creates/deletes keys as needed. Prefer per-key operations for performance.

Attributes

Source
STM.scala
def set(key: => K, newValue: => V): Txn[Unit]

Upserts a key-value pair.

Upserts a key-value pair. Creates the key if not present.

Attributes

Source
STM.scala