ExperimentalExperimentalRemoves and returns the first message from the queue for a specific task.
The task identifier
OptionalsessionId: stringOptional session ID for binding the query to a specific session
The first message, or undefined if the queue is empty
ExperimentalRemoves and returns all messages from the queue for a specific task. Used when tasks are cancelled or failed to clean up pending messages.
The task identifier
OptionalsessionId: stringOptional session ID for binding the query to a specific session
Array of all messages that were in the queue
ExperimentalAdds a message to the end of the queue for a specific task. Atomically checks queue size and throws if maxSize would be exceeded.
The task identifier
The message to enqueue
OptionalsessionId: stringOptional session ID for binding the operation to a specific session
OptionalmaxSize: numberOptional maximum queue size - if specified and queue is full, throws an error
Interface for managing per-task FIFO message queues.
Similar to
TaskStore, this allows pluggable queue implementations (in-memory, Redis, other distributed queues, etc.).Each method accepts taskId and optional sessionId parameters to enable a single queue instance to manage messages for multiple tasks, with isolation based on task ID and session ID.
All methods are async to support external storage implementations. All data in
QueuedMessagemust be JSON-serializable.See
InMemoryTaskMessageQueuefor a reference implementation