pub struct InputQueue(/* private fields */);Expand description
Messages waiting to join a turn already in progress. Cheap to clone; every clone shares one queue.
Implementations§
Source§impl InputQueue
impl InputQueue
Sourcepub fn push(&self, message: Message)
pub fn push(&self, message: Message)
Add a message for the running turn to pick up at its next reasoning step. Never blocks and never fails: a queue with no turn draining it simply holds what it was given, and the next turn takes it.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether anything is waiting. Cheaper than draining for a host that only wants to know.
Sourcepub fn drain(&self) -> Vec<Message>
pub fn drain(&self) -> Vec<Message>
Take everything queued, in the order it was pushed.
Executors call this only when the next action is a reasoning step,
never mid-batch. That is a protocol constraint, not a preference:
providers require every tool call to be answered by its result, so a
user message wedged between a tool_use and its tool_result makes
the exchange invalid. Steering therefore lands at the next model call —
which is also the first moment the model could act on it anyway.