MemoryCacheStore 类

MemoryCacheStore - 将值存储在内存中。

继承
MemoryCacheStore

构造函数

MemoryCacheStore(max_retries: int = 3)

参数

max_retries
默认值: 3

方法

add

通过创建深层副本添加到存储。

get

检索并在返回之前创建深层副本。 深层副本是确保缓存条目未经修改所必需的。

load

从内存加载 - NoOp。

unload

从内存中卸载。

add

通过创建深层副本添加到存储。

add(keys, values)

参数

keys
必需

存储键

values
必需

store value

get

检索并在返回之前创建深层副本。 深层副本是确保缓存条目未经修改所必需的。

get(keys: Iterable[str], default: Optional[Any] = None) -> Dict[Any, Optional[Any]]

参数

keys
必需

要检索的键。

default
默认值: None

如果该键不存在,则为默认值。

返回

键、值的字典。

load

从内存加载 - NoOp。

load()

unload

从内存中卸载。

unload()