Can be called multiple times. Useful if you for example add additional items at a later time. @returns A promise that settles when the queue becomes empty.
()
| 650 | @returns A promise that settles when the queue becomes empty. |
| 651 | */ |
| 652 | async onEmpty(): Promise<void> { |
| 653 | // Instantly resolve if the queue is empty |
| 654 | if (this.#queue.size === 0) { |
| 655 | return; |
| 656 | } |
| 657 | |
| 658 | await this.#onEvent('empty'); |
| 659 | } |
| 660 | |
| 661 | /** |
| 662 | @returns A promise that settles when the queue size is less than the given limit: `queue.size < limit`. |
no test coverage detected