Caching
CachingΒΆ
Classes:
Name | Description |
---|---|
BaseCache |
Base class for a cache. |
BaseCache
ΒΆ
Base class for a cache.
Methods:
Name | Description |
---|---|
__init__ |
Initialize the cache with a serializer. |
get |
Get the cached values for the given keys. |
aget |
Asynchronously get the cached values for the given keys. |
set |
Set the cached values for the given keys and TTLs. |
aset |
Asynchronously set the cached values for the given keys and TTLs. |
clear |
Delete the cached values for the given namespaces. |
aclear |
Asynchronously delete the cached values for the given namespaces. |
__init__
ΒΆ
__init__(
*, serde: SerializerProtocol | None = None
) -> None
Initialize the cache with a serializer.
get
abstractmethod
ΒΆ
Get the cached values for the given keys.
aget
abstractmethod
async
ΒΆ
Asynchronously get the cached values for the given keys.
set
abstractmethod
ΒΆ
Set the cached values for the given keys and TTLs.
aset
abstractmethod
async
ΒΆ
Asynchronously set the cached values for the given keys and TTLs.
Classes:
Name | Description |
---|---|
InMemoryCache |
|
InMemoryCache
ΒΆ
Bases: BaseCache[ValueT]
Methods:
Name | Description |
---|---|
get |
Get the cached values for the given keys. |
aget |
Asynchronously get the cached values for the given keys. |
set |
Set the cached values for the given keys. |
aset |
Asynchronously set the cached values for the given keys. |
clear |
Delete the cached values for the given namespaces. |
aclear |
Asynchronously delete the cached values for the given namespaces. |
get
ΒΆ
Get the cached values for the given keys.
aget
async
ΒΆ
Asynchronously get the cached values for the given keys.
set
ΒΆ
Set the cached values for the given keys.
aset
async
ΒΆ
Asynchronously set the cached values for the given keys.
Classes:
Name | Description |
---|---|
SqliteCache |
File-based cache using SQLite. |
SqliteCache
ΒΆ
Bases: BaseCache[ValueT]
File-based cache using SQLite.
Methods:
Name | Description |
---|---|
__init__ |
Initialize the cache with a file path. |
get |
Get the cached values for the given keys. |
aget |
Asynchronously get the cached values for the given keys. |
set |
Set the cached values for the given keys and TTLs. |
aset |
Asynchronously set the cached values for the given keys and TTLs. |
clear |
Delete the cached values for the given namespaces. |
aclear |
Asynchronously delete the cached values for the given namespaces. |
__init__
ΒΆ
__init__(
*, path: str, serde: SerializerProtocol | None = None
) -> None
Initialize the cache with a file path.
get
ΒΆ
Get the cached values for the given keys.
aget
async
ΒΆ
Asynchronously get the cached values for the given keys.
set
ΒΆ
Set the cached values for the given keys and TTLs.
aset
async
ΒΆ
Asynchronously set the cached values for the given keys and TTLs.