arrow-fx-stm / arrow.fx.stm

Package arrow.fx.stm

Types

STM Consistent and safe concurrent state updatesinterface STM
TArray A TArray is an array of transactional variables.data class TArray<A>
TMap A TMap is a concurrent transactional implementation of a key value hashmap.data class TMap<K, V>
TMVar A TMVar is a mutable reference that can either be empty or hold a value.data class TMVar<A>
TQueue A TQueue is a transactional unbounded queue which can be written to and read from concurrently.data class TQueue<A>
TSemaphore TSemaphore is the transactional Semaphore.data class TSemaphore
TSet A TSet is a concurrent transactional implementation of a hashset.data class TSet<A>
TVar A TVar is a mutable reference that can only be (safely) accessed inside a STM transaction.class TVar<A>

Functions

atomically Run a transaction to completion.suspend fun <A> atomically(f: STM.() -> A): A
check Retry if b is false otherwise does nothing.fun STM.check(b: Boolean): Unit
newEmptyTMVar fun <A> STM.newEmptyTMVar(): TMVar<A>
newTArray fun <A> STM.newTArray(size: Int, f: (Int) -> A): TArray<A>
fun <A> STM.newTArray(size: Int, a: A): TArray<A>
fun <A> STM.newTArray(vararg arr: A): TArray<A>
fun <A> STM.newTArray(xs: Iterable<A>): TArray<A>
newTMap fun <K, V> STM.newTMap(fn: (K) -> Int): TMap<K, V>
fun <K, V> STM.newTMap(): TMap<K, V>
fun <K, V> STM.newTMap(hash: Hash<K>): TMap<K, V>
newTMVar fun <A> STM.newTMVar(a: A): TMVar<A>
newTQueue fun <A> STM.newTQueue(): TQueue<A>
newTSem fun STM.newTSem(initial: Int): TSemaphore
newTSet fun <A> STM.newTSet(fn: (A) -> Int): TSet<A>
fun <A> STM.newTSet(): TSet<A>
fun <A> STM.newTSet(hash: Hash<A>): TSet<A>
stm Helper to create stm blocks that can be run with STM.orElsefun <A> stm(f: STM.() -> A): STM.() -> A

Do you like Arrow?

Arrow Org
<