MCPcopy Create free account
hub / github.com/sindresorhus/p-queue /

Class

source/priority-queue.ts:11–11  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9} & QueueAddOptions;
10
11export default class PriorityQueue implements Queue<RunFunction, PriorityQueueOptions> {
12 readonly #queue: Array<PriorityQueueOptions & {run: RunFunction}> = [];
13
14 // The queue is stored as a sorted array, but dequeued items are left before `#head` until compaction. Only items from `#head` onward are live, which keeps repeated dequeues amortized O(1).

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected