Core Library0.xAPI reference

Choose documentation 1

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

MoreLess about this notice

method libtmux-kotlin

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.withLiveState
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.Language documentation fun <R> Server.withLiveState( session: Session, attachTimeout: Duration = config.defaultTimeout().toKotlinDuration(), block: Kotlin suspending functionsAllows a function to call suspending operations and pause without blocking a thread. It does not start a coroutine by itself.Language documentation (StateFlow<ServerMirror.View>) -> R, ): R

Description

liveState's pump runs until scope ends, by design (a caller collecting it for the life of a program passes its own long-lived scope) — which means a bare coroutineScope { liveState(...) } never returns: coroutineScope waits for every child, the pump included, and nothing inside it asks the pump to stop. This cancels that one child explicitly once block is done, whether it returns or throws.

Type parameters
Parameters

Recorded calls

source calls
No call edges in the Kotlin model.

The 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 material

Pages that discuss withLiveState.

Esc
Search in

Type to search.

Reference previewOpen reference