Skip to content

Send only the new part of a log to its pane - #61

Merged
fedonman merged 1 commit into
mainfrom
fixed/send-only-new-log-bytes
Sep 30, 2026
Merged

fedonman merged 1 commit into
mainfrom
fixed/send-only-new-log-bytes

Conversation

@fedonman

Copy link
Copy Markdown
Owner

The log reader sent a clone of everything it had read on every poll, so an open pane on an idle 20 MB log pushed 20 MB a second through the channel. It now sends a LogChunk: Replace on the first read and after a truncation or a read error, Append with only the new text otherwise, and nothing when the file has not changed. The widgets append instead of replacing, and the reader no longer keeps its own copy of the log. Tests cover an unchanged file and a read after an error.

Closes #19

@fedonman fedonman added this to the v0.3.0 milestone Sep 29, 2026
The reader appended every read to a buffer it never trimmed and sent
a clone of the whole buffer on every poll, whether or not the file had
changed. It now sends a LogChunk: Replace on the first read and after
a truncation or a read error, Append with just the new text otherwise,
and nothing when the read comes back empty. The widgets apply the
chunk to their content, so the reader no longer keeps a copy of its
own.
@fedonman
fedonman force-pushed the fixed/send-only-new-log-bytes branch from e63071e to b0ee8aa Compare September 30, 2026 12:59
@fedonman
fedonman merged commit 8f79501 into main Sep 30, 2026
6 checks passed
@fedonman
fedonman deleted the fixed/send-only-new-log-bytes branch September 30, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: The whole log is copied through the channel every poll, even when nothing changed

1 participant