可完成的(任务或操作)未来会话(Session)服务(Service)

Java-friendly wrapper around a SessionService that it owns: each method calls the suspend method of the same name and returns a CompletableFuture of its result, so Java callers never pass a Continuation. Each call runs in the caller's OpenTelemetry context and in the coroutineContext passed to it, such as MDCContext() from kotlinx-coroutines-slf4j to carry the caller's MDC. Canceling a future cancels its call, a Job in coroutineContext is ignored, and close cancels every call in flight, then closes the service if it is AutoCloseable.

类型

Link copied to clipboard
object Companion

函数

Link copied to clipboard
fun appendEvent(session: Session, event: Event, coroutineContext: CoroutineContext = EmptyCoroutineContext): CompletableFuture<Event>

调用(函数或方法) SessionService.appendEvent该功能用于更新(相关内容)。 session 这个任务已经在另一个线程中执行了,所以请继续你的工作吧。 session 独自一人,直到未来成为现实。

Link copied to clipboard

适用于已转换为 Kotlin 语言的代码的封装会话服务(wrapped session service)。

Link copied to clipboard
open override fun close()

在通话进行中取消通话;如果该服务仍处于开启状态,则关闭该服务。 AutoCloseable后续的每次调用都会返回一个已被取消的“future”对象(即那些原本应该在未来某个时间执行的操作)。

Link copied to clipboard
fun closeSession(session: Session, coroutineContext: CoroutineContext = EmptyCoroutineContext): CompletableFuture<Void?>

调用(函数或方法) SessionService.closeSession.

Link copied to clipboard
fun createSession(key: SessionKey, state: Map<String, Any>? = null, coroutineContext: CoroutineContext = EmptyCoroutineContext): CompletableFuture<Session>

调用(函数或方法) SessionService.createSession.

Link copied to clipboard
fun deleteSession(key: SessionKey, coroutineContext: CoroutineContext = EmptyCoroutineContext): CompletableFuture<Void?>

调用(函数或方法) SessionService.deleteSession.

Link copied to clipboard
fun flush(key: SessionKey? = null, coroutineContext: CoroutineContext = EmptyCoroutineContext): CompletableFuture<Void?>

调用(函数或方法) SessionService.flush.

Link copied to clipboard
fun getSession(key: SessionKey, config: GetSessionConfig? = null, coroutineContext: CoroutineContext = EmptyCoroutineContext): CompletableFuture<Session?>

调用(函数或方法) SessionService.getSession;未来正在逐渐成形(或:未来正在逐步实现)。 null 如果不存在会话(session)的话……

Link copied to clipboard
fun listEvents(key: SessionKey, coroutineContext: CoroutineContext = EmptyCoroutineContext): CompletableFuture<ListEventsResponse>

调用(函数或方法) SessionService.listEvents.

Link copied to clipboard
fun listSessions(appName: String, userId: String, coroutineContext: CoroutineContext = EmptyCoroutineContext): CompletableFuture<ListSessionsResponse>

调用(函数或方法) SessionService.listSessions.