denoland / denoland/std

Feature request (async): limit() to limit a function concurrency

Open
#4,766 12 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3.6k
Forks
681
PR merge metrics
No merged PRs in 30d

Description

Is your feature request related to a problem? Please describe.
I find [p-limit](https://www.npmjs.com/package/p-limit) helpful (APIs often limit user concurrency). The async module already has retry, debounce, and pooledMap which are similar.
An API like p-limit in deno-std will be great.
```javascript
import pLimit from 'p-limit';

const limit = pLimit(10);

// only 10 concurrent requests
export const geocodeAddress = limit(async (address: string) => {...})
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.