构造函数
属性
只读memcached
memcached: Memcached
只读servers
servers: Location
方法
deleteData
-
deleteData(database: string, table: string, key: CacheKey): Promise<boolean>
参数
- database: string
- table: string
- key: CacheKey
返回 Promise<boolean>
deleteKeys
-
deleteKeys( database: string, table: string, keys: readonly CacheKey[],): Promise<void>
参数
- database: string
- table: string
- keys: readonly CacheKey[]
返回 Promise<void>
getData
-
返回 Promise<(Value | null)[]>
setData
-
setData<Value extends object>( database: string, table: string, key: CacheKey, data: Value,): Promise<boolean>
基于 Memcached 的 Cache 实现。
批量读取会拆分,以确保每条 Memcached
get命令,且不超过协议规定的 250 字符 key 命令上限。批量删除最多使用十个并发 worker。