patch

open suspend override fun patch(key: String, payload: ByteArray, maxAgeMs: Long?, tags: Set<String>?)

PATCH-style write. Replaces the payload of key but preserves maxAgeMs and tags when their argument is null.

Semantics per parameter:

  • maxAgeMs = null → keep existing entry's TTL. 0 → no explicit expiry. >0 → use it.

  • tags = null → keep existing entry's tags. emptySet() → explicitly clear. Non-empty → replace.

The createdAt timestamp resets — a patch is a new write, freshness window restarts. If key has no existing entry, falls back to: maxAgeMs = 0, tags = emptySet().