Constructs a new priority queue.
Default timeout used for remove() call when no timeout was specified. Defaults to Number.POSITIVE_INFINITY.
Get the number of elements in the queue.
Get the number of pending promises if no elements are in the queue.
Add data to the queue.
This will throw if the queue is full.
lower values will have higher priority
Get element from queue.
If no element is in the queue, then the promise will not resolve, until there is.
Optional
timeout: numberTimeout as unsigned 32-bit integer or Number.POSITIVE_INFINITY. If undefined use the default value passed to the constructor.
Static
compare
A queue implementation where the reader promises block until new data is available.