Constructs a new blocking 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.
Add data to the queue but insert it at given index.
0 means that the element becomes the first value in the queue. buffer.length means that the element will become the last element. Negative values means that it is inserted from behind (same as array.slice start parameter)
This will throw if the queue is full.
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.
A queue implementation where the reader promises block until new data is available.