We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WTF Node?] open handles: - Timers: - (58570 ~ 58 s) (anonymous) @ file:///.../node_modules/p-queue/dist/index.js:283 - Intervals: - (60000 ~ 60 s) (anonymous) @ file:///.../node_modules/p-queue/dist/index.js:322
dist/index.js:283 dist/index.js:322
First it hangs on dist/index.js:283; and then, if you let it run for a while, on dist/index.js:322 as well.
dist/index.js:283
dist/index.js:322
My code is analogous to:
(async () => { for (let i = 0;i < 4;i++) { await Q.add(() => sth()) } // await Q.onIdle() // console.log("this is reached (ofc)") })()
say
// initialized outside the async arrow (lexical scope) // also hangs when this is // initialized inside the async arrow ('async context') const Q = new PQueue({ concurrency: 100, intervalCap: 500, interval: 60 * 1000 })
$ nvm current v16.15.0 $ lsb_release -d Description: Pop!_OS 20.04 LTS
re sindresorhus/p-throttle#6 (comment)
The text was updated successfully, but these errors were encountered:
This seems more dependable, in the foreseeable future:
import pLimit from "p-limit" import pThrottle from "p-throttle" // no feature parity export default ({ concurrency, intervalCap, interval }) => { const limit = pLimit(concurrency) const throttle = pThrottle({ limit: intervalCap, interval }) return { add: th => throttle(() => limit(th))() } }
Sorry, something went wrong.
I experienced the same issue when using larger interval, say 1 minute (interval: 60000). The whole program seem to hang for that minute.
interval
interval: 60000
No branches or pull requests
dist/index.js:283
dist/index.js:322
First it hangs on
dist/index.js:283
; and then, if you let it run for a while, ondist/index.js:322
as well.My code is analogous to:
say
re
sindresorhus/p-throttle#6 (comment)
The text was updated successfully, but these errors were encountered: