Skip to main content

Module event_queue

Module event_queue 

Source
Expand description

Event queue for server-side streaming.

The executor writes StreamResponse events to an EventQueueWriter; the HTTP layer reads them from an EventQueueReader and serializes them as SSE frames.

InMemoryQueueWriter and InMemoryQueueReader are backed by a bounded tokio::sync::mpsc channel.

Structs§

EventQueueManager
Manages event queues for active tasks.
InMemoryQueueReader
In-memory EventQueueReader backed by an mpsc channel receiver.
InMemoryQueueWriter
In-memory EventQueueWriter backed by an mpsc channel sender.

Constants§

DEFAULT_MAX_EVENT_SIZE
Default maximum event size in bytes (16 MiB).
DEFAULT_QUEUE_CAPACITY
Default channel capacity for event queues.
DEFAULT_WRITE_TIMEOUT
Default write timeout for event queue sends (5 seconds).

Traits§

EventQueueReader
Trait for reading streaming events.
EventQueueWriter
Trait for writing streaming events.

Functions§

new_in_memory_queue
Creates a new in-memory event queue pair with the default capacity and default max event size.
new_in_memory_queue_with_capacity
Creates a new in-memory event queue pair with the specified capacity and default max event size.
new_in_memory_queue_with_options
Creates a new in-memory event queue pair with the specified capacity and maximum event size.