MCPcopy Create free account

hub / github.com/sindresorhus/p-queue / functions

Functions73 in github.com/sindresorhus/p-queue

↓ 434 callersMethodadd
(function_: Task<TaskResultType>, options: Partial<EnqueueOptionsType> = {})
source/index.ts:444
↓ 77 callersMethodonIdle
The difference with `.onEmpty` is that `.onIdle` guarantees that all work from the queue has finished. `.onEmpty` merely signals that the queue is emp
source/index.ts:682
↓ 31 callersMethoddequeue
()
source/priority-queue.ts:82
↓ 26 callersMethodenqueue
(run: RunFunction, options?: Partial<PriorityQueueOptions>)
source/priority-queue.ts:17
↓ 25 callersMethodstart
Start (or resume) executing enqueued tasks within concurrency limit. No need to call this if queue is not paused (via `options.autoStart = false` or b
source/index.ts:595
↓ 23 callersFunctioncreateRun
(value: string)
test/priority-queue.ts:5
↓ 19 callersMethodclear
Clear the queue.
source/index.ts:616
↓ 16 callersMethodonPendingZero
The difference with `.onIdle` is that `.onPendingZero` only waits for currently running tasks to finish, ignoring queued tasks. @returns A promise t
source/index.ts:696
↓ 14 callersMethodpause
Put queue execution on hold.
source/index.ts:609
↓ 13 callersMethodonEmpty
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
source/index.ts:652
↓ 13 callersMethodsetPriority
Updates the priority of a promise function by its id, affecting its execution order. Requires a defined concurrency limit to take effect. For exampl
source/index.ts:432
↓ 9 callersMethodonRateLimit
@returns A promise that settles when the queue becomes rate-limited due to intervalCap.
source/index.ts:707
↓ 8 callersFunctionassertSlidingWindow
(executionTimes: number[], interval: number, intervalCap: number, jitterMilliseconds = Math.min(25, Math.trunc
test/strict.ts:6
↓ 8 callersMethodfilter
(options: Readonly<Partial<PriorityQueueOptions>>)
source/priority-queue.ts:102
↓ 7 callersMethodonError
()
source/index.ts:756
↓ 6 callersMethod#onEvent
(event: EventName, filter?: () => boolean)
source/index.ts:767
↓ 6 callersMethodremove
(idOrRun: string | RunFunction)
source/priority-queue.ts:63
↓ 5 callersMethod#scheduleRateLimitUpdate
()
source/index.ts:832
↓ 5 callersMethodaddAll
( functions: ReadonlyArray<Task<TaskResultsType>>, options?: Partial<EnqueueOptionsType>, )
source/index.ts:585
↓ 5 callersFunctionaddBenchmark
(name: string, fn: () => Promise<void>)
bench.ts:19
↓ 5 callersMethodonSizeLessThan
@returns A promise that settles when the queue size is less than the given limit: `queue.size < limit`. If you want to avoid having the queue grow b
source/index.ts:668
↓ 4 callersMethod#tryToStartAnother
()
source/index.ts:289
↓ 4 callersMethodsizeBy
Size of the queue, filtered by the given options. For example, this can be used to find the number of items remaining in the queue with a specific p
source/index.ts:794
↓ 3 callersMethod#cleanupStrictTicks
(now: number)
source/index.ts:137
↓ 3 callersMethod#clearIntervalTimer
()
source/index.ts:275
↓ 3 callersMethod#createIntervalTimeout
(delay: number)
source/index.ts:265
↓ 3 callersMethod#getActiveTicksCount
()
source/index.ts:179
↓ 3 callersMethod#processQueue
Executes all queued functions until it reaches the limit.
source/index.ts:377
↓ 3 callersMethodonRateLimitCleared
@returns A promise that settles when the queue is no longer rate-limited.
source/index.ts:718
↓ 2 callersMethod#clearTimeoutTimer
()
source/index.ts:282
↓ 2 callersMethod#compact
()
source/priority-queue.ts:119
↓ 2 callersMethod#initializeIntervalIfNeeded
()
source/index.ts:340
↓ 2 callersMethod#onInterval
()
source/index.ts:360
↓ 2 callersMethod#updateRateLimitState
()
source/index.ts:854
↓ 2 callersFunctionmonitorState
()
test/advanced.ts:1718
↓ 1 callersMethod#consumeIntervalSlot
(now: number)
source/index.ts:160
↓ 1 callersMethod#isIntervalPausedAt
(now: number)
source/index.ts:219
↓ 1 callersMethod#next
()
source/index.ts:200
↓ 1 callersMethod#onResumeInterval
()
source/index.ts:211
↓ 1 callersMethod#rollbackIntervalConsumption
()
source/index.ts:845
↓ 1 callersMethod#rollbackIntervalSlot
()
source/index.ts:168
↓ 1 callersMethod#setupRateLimitTracking
()
source/index.ts:813
↓ 1 callersFunctioncreateTransitions
()
test/rate-limit.ts:233
↓ 1 callersFunctionlowerBound
(array: readonly T[], value: T, comparator: (a: T, b: T) => number)
source/lower-bound.ts:3
↓ 1 callersMethodrun
()
source/index.ts:458
↓ 1 callersFunctionshouldRunBenchmark
(name: string)
bench.ts:16
↓ 1 callersFunctionstartPauseCycles
()
test/rate-limit.ts:25
↓ 1 callersFunctionsuccessTask
()
test/strict.ts:700
↓ 1 callersFunctiontimeoutTask
()
test/strict.ts:687
Method#doesConcurrentAllowAnother
()
source/index.ts:196
Method#doesIntervalAllowAnother
()
source/index.ts:183
MethodcleanupQueueAbortHandler
()
source/index.ts:457
Methodconcurrency
()
source/index.ts:382
Methodconstructor
(options?: Options<QueueType, EnqueueOptionsType>)
source/index.ts:85
Functionfn
(deferred: Resolvable)
bench.ts:27
Functionfn
()
test/basic.ts:653
Functionfn1
()
test/basic.ts:666
Functionfn2
()
test/basic.ts:670
Functionfn3
()
test/basic.ts:674
MethodhandleError
(error: unknown)
source/index.ts:758
MethodisPaused
Whether the queue is currently paused.
source/index.ts:809
MethodisRateLimited
Whether the queue is currently rate-limited due to intervalCap.
source/index.ts:888
MethodisSaturated
Whether the queue is saturated. Returns `true` when: - All concurrency slots are occupied and tasks are waiting, OR - The queue is rate-limited and
source/index.ts:918
Methodlistener
()
source/index.ts:769
Functionmapper
([value, ms]: readonly number[])
test/basic.ts:47
Functionnoop
()
bench.ts:14
Methodpending
Number of running items (no longer in the queue).
source/index.ts:802
MethodqueueAbortHandler
()
source/index.ts:548
MethodremoveQueuedTask
()
source/index.ts:535
MethodrunningTasks
The tasks currently being executed. Each task includes its `id`, `priority`, `startTime`, `timeout` (if set), and `timeoutRemaining` (milliseconds unt
source/index.ts:954
MethodsetPriority
(id: string, priority: number)
source/priority-queue.ts:50
Methodsize
Size of the queue, the number of queued items waiting to run.
source/index.ts:785
Methodsize
()
source/priority-queue.ts:115