serve: SSE live pump should read incrementally instead of full file #130

Closed
opened 2026-05-08 08:49:32 +00:00 by xingyue · 0 comments
Owner

Context

PR #129 review feedback.

Problem

pumpData() in routes-live.ts reads the entire .data.jsonl file on every fs watch event. For long-running threads with large JSONL files, this becomes a performance bottleneck.

Solution

Use fd + read() with byte offset tracking, or stream the file from the last known position instead of readFile() + slice.

Ref

Follow-up from #129, part of #118

## Context PR #129 review feedback. ## Problem `pumpData()` in `routes-live.ts` reads the entire `.data.jsonl` file on every fs watch event. For long-running threads with large JSONL files, this becomes a performance bottleneck. ## Solution Use `fd + read()` with byte offset tracking, or stream the file from the last known position instead of `readFile()` + slice. ## Ref Follow-up from #129, part of #118
This repo is archived. You cannot comment on issues.
No Label
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#130