Skip to main content

Module write_queue

Module write_queue 

Source
Expand description

Bounded-backpressure stdin queue (design module write_queue.rs).

Inputs destined for an agent’s PTY stdin are enqueued here rather than written directly, so a slow or wedged child cannot block the caller and a burst of ask/drive keystrokes cannot grow memory without bound. The queue is capacity-bounded; enqueue returns WriteQueueError::Full when at capacity so the caller surfaces backpressure rather than buffering forever.

Runtime-agnostic by design (Wave 1): the worker’s writer loop pops messages and writes them to the PTY master. Wave 3’s daemon drives this from a tokio task; nothing here assumes an async runtime.

Structs§

WriteQueue
FIFO queue with a hard message-count capacity.

Enums§

WriteMsg
A single unit of work for the PTY writer.
WriteQueueError