AbstractContinuousSessionContext
abstract class AbstractContinuousSessionContext<T, R>(coroutineContext: CoroutineContext) : ContinuousSessionContext<T, R> (source)
针对 ContinuousSessionContext 的基础抽象实现类。
Author
ForteScarlet
Functions
Link copied to clipboard
protected abstract fun <C> computeSession(key: ContinuousSessionKey<C>, inSession: InSession<C, T, R>): ContinuousSessionProvider<C, T, R>
Link copied to clipboard
判断是否包含某个 key 对应的会话。
Link copied to clipboard
open operator override fun <C> get(key: ContinuousSessionKey<C>): ContinuousSessionProvider<C, T, R>?
根据 key 获取指定的 ContinuousSessionProvider 并在找不到时返回 null
。
Link copied to clipboard
移除某个指定 key 的会话。 remove 仅会从记录中移除,不会使用 ContinuousSessionProvider.cancel, 需要由调用者主动使用。
Link copied to clipboard
open override fun <C> session(key: ContinuousSessionKey<C>, strategy: ContinuousSessionContext.ConflictStrategy, inSession: InSession<C, T, R>): ContinuousSessionProvider<C, T, R>
尝试创建一组 ContinuousSession
并返回其中的 ContinuousSessionProvider。 在出现 key 冲突时基于 strategy 策略处理冲突。
Inherited functions
Link copied to clipboard
open fun <C> session(key: ContinuousSessionKey<C>, inSession: InSession<C, T, R>): ContinuousSessionProvider<C, T, R>
尝试创建一组 ContinuousSession
, 并在出现 key 冲突时使用 ConflictStrategy.FAILURE 作为冲突解决策略。