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.

Return

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

Parameters

block

reader invoked with the current front buffer.