This package has been deprecated

Author message:

channel has been renamed to repeater, see https://github.com/repeaterjs/repeater/issues/18 for the rationale and https://github.com/repeaterjs/repeater/pull/28 for an upgrade guide. Apologies.

@channel/limiters
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

@channel/limiters

This package is experimental!

Basic async iterators for limiting concurrency, implemented with channels

For more information, visit channel.js.org.

interface Token {
  readonly id: number;
  readonly limit: number;
  readonly remaining: number;
  release(): void;
}

function semaphore(limit: number): Channel<Token>;

interface ThrottleToken extends Token {
    readonly reset: number;
}

function throttler(wait: number, options?: {
    limit?: number;
    cooldown?: boolean;
}): Channel<ThrottleToken>;

Readme

Keywords

none

Package Sidebar

Install

npm i @channel/limiters

Weekly Downloads

1

Version

0.2.1

License

MIT

Unpacked Size

27.7 kB

Total Files

9

Last publish

Collaborators

  • brainkim