Cache¶
Bases: Protocol
Interface for pluggable cache backends.
Any object implementing this protocol can be passed to
:class:~themeparks.ThemeParks or :class:~themeparks.AsyncThemeParks
as the cache= argument. The contract is intentionally small:
get(key)returns the cached value, orNoneon miss or expiry.set(key, value, ttl_seconds)storesvalueunderkeywith a TTL expressed in seconds; implementations are free to ignore or clamp non-positive TTLs.delete(key)evicts an entry; a missing key must not raise.
The SDK itself does not call set for paths whose TTL is 0 (see
:func:ttl_for_path), so backends rarely need special-case logic.