RetrostashEngine
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.
Adapters (RetrostashOkHttpInterceptor, RetrostashKtorRuntime) construct one engine per client and dispatch transport metadata into resolveFromCache, persistQueryResult, invalidateTemplates, invalidateTags, and clearAll.
Constructors
Link copied to clipboard
constructor(store: RetrostashStore, keyResolver: CoreKeyResolver = CoreKeyResolver(), timeoutMs: Long = 250)
Functions
Link copied to clipboard
Link copied to clipboard
Invalidates every entry whose key contains |<template>| for any of templates.
Link copied to clipboard
suspend fun patchQueryResult(metadata: QueryMetadata, payload: ByteArray, maxAgeMs: Long? = null, tagsOverride: Set<String>? = null)
PATCH-style write. Replaces payload under the resolved metadata key. maxAgeMs and tagsOverride use null-means-preserve semantics (see RetrostashStore.patch).
Link copied to clipboard
Link copied to clipboard