Skip to main content
interface Limit
import { type Limit } from "https://deno.land/x/p_limit@v1.0.0/mod.d.ts";

Call Signatures

<Arguments extends unknown[], ReturnType>(fn: (...args: Arguments) => PromiseLike<ReturnType> | ReturnType, ...args: Arguments): Promise<ReturnType>

Properties

readonly
activeCount: number

The number of promises that are currently running.

readonly
pendingCount: number

The number of promises that are waiting to run (i.e. their internal fn was not called yet).

clearQueue: () => void

Discard pending promises that are waiting to run. This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app. Note: This does not cancel promises that are already running.