sindresorhus / p-queue

Promise queue with concurrency control
MIT License
3.41k stars 182 forks source link

Does it work across multiple Node.js processes? #139

Closed animir closed 3 years ago

sindresorhus commented 3 years ago

No, nothing on npm works across processes unless explicitly noted.

animir commented 3 years ago

@sindresorhus p-queue or another package could

sindresorhus commented 3 years ago

Sure. I'm just not interested in maintaining a package with that kind of complexity.

animir commented 3 years ago

@sindresorhus It may be much easier than you think. The reason I raised this topic is that you have already got a lot of experience around concurrent promises and limits. Also, I am maintainer of a rate-limiter-flexible package. Essentially, it provides transparent API to make atomic increments with different storages. I presume, p-queue already counts events in memory, so it could just change the way counter incremented/decremented depending on events.

sindresorhus commented 3 years ago

It's not just about how easy it is to add. I have to maintain and do support for it. That being said, if you can find a way to make a hook in p-queue so users can use rate-limiter-flexible with p-queue, I'm happy to have that added.