MemoryStore

interface MemoryStore(source)

Where memory lives. Mutations are compare-and-swap on MemoryFile.version so a stale write fails instead of overwriting a concurrent edit.

Inheritors

Functions

Link copied to clipboard
abstract suspend fun delete(name: String, expectedVersion: String)

Delete if the current version is expectedVersion.

Link copied to clipboard
abstract suspend fun list(limit: Int): List<String>
Link copied to clipboard
abstract suspend fun read(name: String, maxChars: Int): MemoryFile?
Link copied to clipboard
abstract suspend fun write(name: String, content: String, expectedVersion: String?): String

Write content if the file's current version is expectedVersion (null = must not exist). Returns the new version.