KetraTerm
API · DevelopmentAll versions

readCurrent

inline fun <T> readCurrent(block: (TerminalRenderCache) -> T): T?

Reads the latest published front buffer while preventing it from being recycled as a writer-owned back buffer.

The callback should only copy or paint from the cache and must not call back into this publisher. Returning null means no frame has been published yet, or the callback itself returns null. Callback failures and non-local returns release the lease before propagating to the caller.

Return

block's result, or null when no frame is available.

Parameters

block

reader invoked with the current front buffer.