Software Transactional Memory runtime for Cats Effect.
STM provides composable in-memory transactions with automatic concurrency management including locking, retries, semantic blocking, and intelligent scheduling. Create a runtime via STM.runtime and use the implicit syntax classes to build and commit transactions.
import bengal.stm.model.TxnVar
STM.runtime[IO].flatMap { implicit stm =>
for {
counter <- TxnVar.of[IO, Int](0)
_ <- counter.modify(_ + 1).commit
value <- counter.get.commit
} yield value
}
Type parameters
- F
-
the effect type (must have an
Asyncinstance)
Attributes
Members list
Type members
Classlikes
Provides commit and error-handling operations on Txn values.
Provides commit and error-handling operations on Txn values.
Attributes
- Source
- STM.scala
- Supertypes
-
class Objecttrait Matchableclass Any
Provides transaction operations on TxnVarMap instances.
Provides transaction operations on TxnVarMap instances. Automatically available when an STM[F] is implicit.
Attributes
- Source
- STM.scala
- Supertypes
-
class Objecttrait Matchableclass Any
Value members
Abstract methods
Creates a new transactional variable with the given initial value.
Creates a new transactional map with the given initial entries.
Inherited methods
Attributes
- Inherited from:
- TxnApiContext (hidden)
- Source
- TxnApiContext.scala
Attributes
- Inherited from:
- TxnApiContext (hidden)
- Source
- TxnApiContext.scala
Attributes
- Inherited from:
- TxnApiContext (hidden)
- Source
- TxnApiContext.scala
Attributes
- Inherited from:
- TxnApiContext (hidden)
- Source
- TxnApiContext.scala
Attributes
- Inherited from:
- TxnApiContext (hidden)
- Source
- TxnApiContext.scala
Inherited fields
Attributes
- Inherited from:
- TxnApiContext (hidden)
- Source
- TxnApiContext.scala
Implicits
Implicits
Provides commit and error-handling operations on Txn values.
Provides transaction operations on TxnVarMap instances.
Provides transaction operations on TxnVarMap instances. Automatically available when an STM[F] is implicit.
Attributes
- Source
- STM.scala