3.3.0 • Published 1 year ago

task-simple-limiter v3.3.0

Weekly downloads
-
License
GPL-2.0-or-later
Repository
github
Last release
1 year ago

Task Simple Limiter

github action github action Coverage Status

本包可以方便的给异步任务限流,也就是并发控制。

Task Simple Limiter can control your tasks concurrency conveniently.

用例 Usage

初始化 Initialization

import Limiter from 'task-simple-limiter';

const limiter = new Limiter({ concurrency: 2 });

阻塞任务来限流 Blocking Task

async function task() {
  const release = await limiter.hold();
  try {
    await somethingAsync();
  }
  finally {
    release();
  }
}

链接 Links

  • concurrency-limiter

    限制并发的实现方式与本包类似。

    The way to control concurrency is similar to this package.

3.3.0

1 year ago

2.2.3

2 years ago

2.2.2

2 years ago

2.2.1

2 years ago

2.2.0

2 years ago

1.1.0

2 years ago