MCPcopy
hub / github.com/sindresorhus/p-queue / onEmpty

Method onEmpty

source/index.ts:652–659  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

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`.

Callers 3

bench.tsFile · 0.80
advanced.tsFile · 0.80
basic.tsFile · 0.80

Calls 1

#onEventMethod · 0.95

Tested by

no test coverage detected