ContinuousSessionProvider

持续会话的结果提供者,通过 ContinuousSessionContext.getReceiver 构建获取,向目标会话推送一个结果。

当使用push推送结果、使用pushException推送错误或者通过cancel终止会话的时候, 此提供者对应的接收者 ContinuousSessionReceiver 会得到相对应的结果。

See also

Functions

Link copied to clipboard
abstract fun cancel(reason: Throwable? = null)

关闭此会话。

Link copied to clipboard
abstract fun invokeOnCompletion(handler: CompletionHandler)

当完成时执行.

Link copied to clipboard
abstract fun push(value: T)

向其对应的 ContinuousSessionReceiver 推送一个结果。 正常来讲,一个 session 只能够推送一次,如果多次推送可能会导致异常, 注意处理。

Link copied to clipboard
abstract fun pushException(e: Throwable)

向目标推送一个错误。

Properties

Link copied to clipboard
abstract val isCompleted: Boolean

是否已经完成。不论是 pushpushException 还是 cancel, 执行后都视为完成