Server.withLiveState
As liveState, scoped to block: opens the live view, runs block against it, and cancels the background pump before returning — the same withServer/withControl shape, for the one resource liveState itself cannot close on its own.
Source and package
- Qualified name
-
io.github .libtmux .kotlin .Server. with Live State - Package
- io.github.libtmux.kotlin
- Declared in
Server- Distribution
- io.github.libtmux:libtmux-kotlin
- Source
- libtmux-kotlin/src/main/kotlin/io/github/libtmux/kotlin/LiveState.kt
- public
Kotlin suspending functionsAllows a function to call suspending operations and pause without blocking a thread. It does not start a coroutine by itself. fun <R> Server.withLiveState( session: Session, attachTimeout : Duration = config.defaultTimeout ().toKotlin (), block:Duration Kotlin suspending functionsAllows a function to call suspending operations and pause without blocking a thread. It does not start a coroutine by itself. (StateFlow <ServerMirror >) -> R, ): R.View -
Description
liveState's pump runs untilscopeends, by design (a caller collecting it for the life of a program passes its own long-lived scope) — which means a barecoroutineScope { liveState(...) }never returns:coroutineScopewaits for every child, the pump included, and nothing inside it asks the pump to stop. This cancels that one child explicitly onceblockis done, whether it returns or throws.
Recorded calls
source callsThe Kotlin reference records declarations, not calls, so this page shows no callers or callees. That is a limit of the extracted data, not a statement that nothing calls io.github.libtmux.kotlin.Server.withLiveState.
Guides
task materialPages that discuss withLiveState.