Skip to main content

Module queue

Module queue 

Source
Expand description

Message queueing: follow-ups typed while a reply runs.

While a chat is busy, crate::ClientMsg::SendMessage appends to that chat’s queue in the engine instead of being refused. When the running turn ends normally the engine starts the first queued message as the next turn, and so on. A turn that is stopped or fails pauses the queue (ChatQueue::paused); it stays, untouched, until a client resumes it (crate::ClientMsg::ResumeQueue), sends one item now (crate::ClientMsg::SendQueuedNow) or retries the failed reply. A turn waiting for an approval simply keeps the queue waiting.

The queue lives in the engine (so every client of the chat sees the same one, and it survives a closed window or tab) but only in memory: it is gone after an engine restart. Queued messages are not part of the transcript until they are sent.

Structs§

ChatQueue
The queue of the chat a client looks at (chat: None for a new chat: always empty). Sent after crate::ServerMsg::Transcript and whenever it changes; replaces the client’s copy.
QueuedMessage
A message waiting to be sent.

Enums§

QueuePause
Why a queue stopped moving on.

Constants§

MAX_QUEUED
Most messages queued in one chat.
MAX_QUEUED_TEXT_BYTES
Most bytes of text in one queued message.
MAX_QUEUE_BYTES
Most bytes of text in one chat’s whole queue.