ExperimentalExperimentalExperimentalRemoves 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.
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
A simple in-memory implementation of TaskMessageQueue for demonstration purposes.
This implementation stores messages in memory, organized by task ID and optional session ID. Messages are stored in FIFO queues per task.
Note: This is not suitable for production use in distributed systems. For production, consider implementing TaskMessageQueue with Redis or other distributed queues.