Package-level declarations

Types

Link copied to clipboard

Builds a stable cache key from QueryMetadata.

Link copied to clipboard

Thread-safe in-memory RetrostashStore. Backed by a LinkedHashMap guarded by a kotlinx.coroutines.sync.Mutex so it works on every KMP target (no synchronized).

Link copied to clipboard
data class QueryMetadata(val scopeName: String, val template: String, val bindings: Map<String, String> = emptyMap(), val bodyBytes: ByteArray? = null, val tagTemplates: List<String> = emptyList())

Transport-agnostic description of a single query call, sufficient for CoreKeyResolver to derive a stable cache key.

Link copied to clipboard
class RetrostashEngine(store: RetrostashStore, keyResolver: CoreKeyResolver = CoreKeyResolver(), timeoutMs: Long = 250)

Transport-agnostic core of Retrostash. Owns the RetrostashStore and resolves cache keys via CoreKeyResolver. Each store call is wrapped in a withTimeoutOrNull of timeoutMs so a stuck or slow store can't block a request — the call falls through to the network instead.

Link copied to clipboard
interface RetrostashStore

Persistent or in-memory backing store for cached query payloads.

Link copied to clipboard

Functions

Link copied to clipboard
suspend fun <T> withStoreTimeoutOrNull(timeoutMs: Long, block: suspend () -> T): T?