OpenRoadCode
Public API reference for OpenRoadCode
Loading...
Searching...
No Matches
cache.persistent_cache_if.PersistentCacheIf Class Reference

Store opaque bytes under stable logical keys. More...

Public Member Functions

bytes|None get (self, str key)
 Return cached bytes or None when the key is absent.
None put (self, str key, bytes data)
 Atomically store bytes under a logical key.
bool remove (self, str key)
 Remove a key if present.

Detailed Description

Store opaque bytes under stable logical keys.

Member Function Documentation

◆ get()

bytes | None cache.persistent_cache_if.PersistentCacheIf.get ( self,
str key )

Return cached bytes or None when the key is absent.

Parameters
keyNon-empty logical cache key.
Returns
Stored bytes or None.

◆ put()

None cache.persistent_cache_if.PersistentCacheIf.put ( self,
str key,
bytes data )

Atomically store bytes under a logical key.

Parameters
keyNon-empty logical cache key.
dataBytes to persist.

◆ remove()

bool cache.persistent_cache_if.PersistentCacheIf.remove ( self,
str key )

Remove a key if present.

Parameters
keyNon-empty logical cache key.
Return values
TrueA stored entry was removed.
FalseThe key was absent.

The documentation for this class was generated from the following file:
  • controllers/cache/persistent_cache_if.py