Skip to main content

Module queue_wait

Module queue_wait 

Source
Expand description

RedWire live queue-wait dispatch (issue #917, PRD #915).

Carries the wire-side envelopes for the live queue-wait happy path:

  • QueueWaitOpen (client→server) — open a wait on a queue. The awaiting session parks on the queue-wait registry’s async wake head (no blocking OS thread) and re-probes the normal delivery path on each wake.
  • QueueEventPush (server→client) — the delivered message, pushed the instant one becomes deliverable on that queue.

Distinct from the OpenStream/StreamChunk output-stream family in super::output_stream, which stays query-result pull. These envelopes carry queue delivery and reuse the frame’s stream_id for multiplexing so a wait can coexist with other streams on the same connection.

Structs§

QueueWaitOpenRequest
Parsed QueueWaitOpen payload. Shape:

Enums§

QueueWaitParseError

Constants§

WAIT_CANCELLED_CODE
StreamError code for a live queue-wait terminated by server-side cancellation (registry cancel_all, e.g. shutdown). Distinct from WAIT_FAILED_CODE (a genuine runtime error) and from the timeout frame, so the three non-delivery outcomes never alias on the wire.
WAIT_EXCEEDS_CAP_CODE
StreamError code for a wait open whose requested budget exceeds the server’s maximum wait cap (issue #919). The accompanying message names the red.config key so an operator can act on it.
WAIT_FAILED_CODE
StreamError code for a runtime failure while servicing a wait (e.g. the queue read errored). Non-fatal at the connection level.

Functions§

build_event_push_frame
Build a QueueEventPush frame echoing the open request’s correlation_id and stream_id so the client pairs the push with the wait it opened.
build_event_push_payload
Build the QueueEventPush payload for one delivered message. The message value is the JSON object rendered by the runtime (message_id / payload / consumer / delivery_count).
build_queue_wait_error_frame
Build a StreamError frame carrying a queue-wait parse/validation failure for a specific stream_id. Non-fatal at the connection level — the session keeps reading other frames.
build_queue_wait_timeout_frame
Build a QueueWaitTimeout frame for an elapsed wait (issue #919).
parse_queue_wait_open