AbstractContinuousSessionContext

针对 ContinuousSessionContext 的基础抽象实现类。

Author

ForteScarlet

Constructors

Link copied to clipboard
constructor(coroutineContext: CoroutineContext)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
protected val subScope: CoroutineScope

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
open operator override fun contains(key: ContinuousSessionKey<*>): Boolean

判断是否包含某个 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
open override fun <C> remove(key: ContinuousSessionKey<C>): ContinuousSessionProvider<C, T, R>?

移除某个指定 key 的会话。 remove 仅会从记录中移除,不会使用 ContinuousSessionProvider.cancel, 需要由调用者主动使用。

Link copied to clipboard

尝试创建一组 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 作为冲突解决策略。