Cancels all pending promises in the queue and rejects them with an AsyncQueueCancelledError.
This ensures that any awaiting code can handle the cancellation appropriately.
Dequeues the next item from the queue and returns a promise that resolves to it.
If the queue is empty, it creates a new promise that will be resolved when an item is enqueued.
Adds an item to the queue. If there are pending dequeued promises, it resolves the oldest promise with the enqueued item
immediately; otherwise, it adds the item to the queue.
Cancels all pending promises in the queue and rejects them with an AsyncQueueCancelledError. This ensures that any awaiting code can handle the cancellation appropriately.