API Reference
cache
Classes:
-
BaseTTLCache–Base class for TTL cache, inherit from this class to implement your own cache.
-
MemoryCache–In-memory cache implementation.
-
RedisCache–Redis cache implementation.
-
SQLiteCache–SQLite cache implementation.
BaseTTLCache
Base class for TTL cache, inherit from this class to implement your own cache.
Methods:
-
clear_expired–Clear expired values from the cache.
-
close–Close the cache, called when
BaseClientis closed. -
delete–Delete the value from the cache.
-
get–Get a value from the cache.
-
set–Set the value in the cache.
-
start–Start the cache, called when
BaseClientis started.
delete
abstractmethod
async
get
abstractmethod
async
set
abstractmethod
async
MemoryCache
In-memory cache implementation.
This cache is not persistent and will be cleared when the program exits.
Methods:
RedisCache
Redis cache implementation.
This cache uses Redis for distributed and persistent caching.
Methods:
SQLiteCache
SQLite cache implementation.
This cache is persistent and will be saved to the specified file.
Methods:
Attributes:
-
conn(Connection) –