InMemorySharedStateStore

Single-process, STM-backed SharedStateStore implementation. Useful for tests and as a reference implementation — it does not coordinate across processes/machines.

Types

Link copied to clipboard

Functions

Link copied to clipboard
open suspend override fun compareAndSet(key: String, expected: String?, new: String): Boolean

Atomically sets key to new only if its current value equals expected (null meaning "absent"). Returns whether the update happened — the building block for distributed counters/state machines.

Link copied to clipboard
open suspend override fun get(key: String): String?

Reads the current value for key, or null if absent.

Link copied to clipboard
open suspend override fun remove(key: String)

Removes key, if present.

Link copied to clipboard
open suspend override fun set(key: String, value: String)

Unconditionally sets key to value.