跳转到内容

SessionIndexStore

可选的会话索引存储:为多副本共享元数据,或为不支持条件写的对象存储提供 CAS 提交点。

get(endUserKey, sessionId): Promise<ColdStoredSessionMeta | null>;

string

string

Promise<ColdStoredSessionMeta | null>


list(endUserKey, cursor?): AsyncIterable<ColdStoredSessionMeta>;

string

string

AsyncIterable<ColdStoredSessionMeta>


remove(endUserKey, sessionId): Promise<void>;

string

string

Promise<void>


upsert(
meta,
expectedGeneration?,
expectedIdentity?
): Promise<void>;

expectedGeneration 不匹配须抛 precondition_failed。支持跨卷严格 CAS 的实现还须在同一提交点 核对 expectedIdentity;数字代际可随换卷重置,不能单独防止跨卷 ABA。 第三参为加法扩展,旧实现仍可忽略,其跨卷保证不因此自动增强。

ColdStoredSessionMeta

number

string

string

Promise<void>