Skip to content

Commit b24accf

Browse files
Kasper JungeRalphify
authored andcommitted
refactor: inline reader thread handle in _read_agent_stream
The `reader` local served only to call `.start()` — the thread is never joined explicitly because termination is signalled through the queue's None sentinel and the daemon flag. Collapsing into the fluent `Thread(...).start()` form matches the fire-and-forget intent and drops an unused binding. Python's `threading` module keeps live threads reachable via `threading._active`, so dropping the local reference does not affect thread lifetime. Co-authored-by: Ralphify <noreply@ralphify.co>
1 parent 1188288 commit b24accf

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/ralphify/_agent.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,7 @@ def _read_agent_stream(
342342
result_text: str | None = None
343343

344344
line_q: queue.Queue[str | None] = queue.Queue()
345-
reader = threading.Thread(target=_readline_pump, args=(stdout, line_q), daemon=True)
346-
reader.start()
345+
threading.Thread(target=_readline_pump, args=(stdout, line_q), daemon=True).start()
347346

348347
while True:
349348
# Compute how long we can wait for the next line.

0 commit comments

Comments
 (0)