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.liveState

A live, continuously rebuilt view of server, as a StateFlow.

Source and package
Qualified name
io.github.libtmux.kotlin.Server.liveState
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 Server.liveState( session: Session, scope: CoroutineScope, attachTimeout: Duration = config.defaultTimeout().toKotlinDuration(), ): StateFlow<ServerMirror.View>

Description

Wraps Java's ServerMirror rather than reinventing it: every routine case — resnapshot on notification, on gap, and on reconnect; conflation while a rebuild is in flight; ending once session itself is gone — is already handled once, correctly, inside ServerMirror. This function's only job is pumping ServerMirror.awaitNewer on a dedicated thread from ExecutionPolicy.streamReads and publishing what comes back. Named liveState, not ServerMirror, so it does not collide with the Java type it wraps.

scope owns the returned StateFlow's whole lifetime: closing the mirror is this function's own launch+finally, tied to scope's cancellation, so the caller never has to close it by hand.

Parameters
Errors

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.liveState.

Guides

task material

Pages that discuss liveState.

Esc
Search in

Type to search.

Reference previewOpen reference