async-sema
- Version 3.1.1
- Published
- 13.5 kB
- No dependencies
- MIT license
Install
npm i async-semayarn add async-semapnpm add async-semaOverview
Semaphore using `async` and `await`
Index
Functions
Classes
Functions
function RateLimit
RateLimit: ( rps: number, { timeUnit, uniformDistribution, }?: { timeUnit?: number; uniformDistribution?: boolean }) => () => Promise<void>;Classes
class Sema
class Sema {}constructor
constructor( nr: number, { initFn, pauseFn, resumeFn, capacity, }?: { initFn?: () => any; pauseFn?: () => void; resumeFn?: () => void; capacity?: number; });method acquire
acquire: () => Promise<any>;method drain
drain: () => Promise<any[]>;method nrWaiting
nrWaiting: () => number;method release
release: (token?: any) => void;method tryAcquire
tryAcquire: () => any | undefined;Package Files (1)
Dependencies (0)
No dependencies.
Dev Dependencies (8)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/async-sema.
- Markdown[](https://www.jsdocs.io/package/async-sema)
- HTML<a href="https://www.jsdocs.io/package/async-sema"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 4080 ms. - Missing or incorrect documentation? Open an issue for this package.
