Open Richienb opened 4 months ago
I have a use case where I have a function that mustn't be running more than x times concurrently because of API restrictions.
I propose the addition of the named export:
function pLimitFunction(function_, concurrency) { const limit = pLimit(concurrency); return (...arguments_) => limit(() => function_(...arguments_)); }
This is similar to #74, except we also define the limiter within the function.
Sounds good.
I think the concurrency parameter should be an options-object instead.
concurrency
What about naming it limitFunction?
limitFunction
I have a use case where I have a function that mustn't be running more than x times concurrently because of API restrictions.
I propose the addition of the named export:
This is similar to #74, except we also define the limiter within the function.