在……里面;在……期间内存会话(Session)服务(Service)

An in-memory implementation of SessionService assuming Session objects are mutable regarding their state map, events list, and last update time.

This implementation stores sessions, user state, and app state directly in memory in a thread-safe manner. It is suitable for testing or single-node deployments where persistence is not required.

Note: State merging (app/user state prefixed with app: / user:) occurs during retrieval operations (getSession, createSession).

构造函数(Constructors)

Link copied to clipboard
constructor()

函数

Link copied to clipboard
open suspend override fun appendEvent(session: Session, event: Event): Event

追加(数据) 事件 给……;发送到…… session将该状态变化(即 “状态增量”)应用到内存中的会话数据中,并记录这一事件。 temp: 这些键会被应用到内存中的状态数据上(这样后续参与调用的代理程序就可以读取这些数据),但之后会从内存中删除这些键。 事件 在数据被持久化(即存储到数据库中)之前。

Link copied to clipboard
open suspend fun closeSession(session: Session)

关闭会话。

Link copied to clipboard
open suspend override fun createSession(key: SessionKey, state: Map<String, Any>? = null): Session

使用指定的参数创建一个新的会话。

Link copied to clipboard
open suspend override fun deleteSession(key: SessionKey)

删除特定的会话。

Link copied to clipboard
open suspend fun flush(key: SessionKey? = null)

在此调用之前,系统会等待所有要写入的数据被追加完成后再进行持久化处理。具体来说,就是那些需要被写入的数据…… key或者,在每次会话开始时(即每次用户登录时)…… key 是 null取消呼叫者的操作会停止等待过程,但不会影响数据的写入操作。

Link copied to clipboard
open suspend override fun getSession(key: SessionKey, config: GetSessionConfig? = null): Session?

检索特定的会话(session),并可选择性地过滤其中包含的事件(events)。

Link copied to clipboard
open suspend override fun listEvents(key: SessionKey): ListEventsResponse

列出特定会话中的所有事件。

Link copied to clipboard
open suspend override fun listSessions(appName: String, userId: String): ListSessionsResponse

列出与特定应用程序和用户关联的会话(session)。