Skip to content

Instantly share code, notes, and snippets.

@wadez
Created June 13, 2021 17:34
Show Gist options
  • Save wadez/17ef156078381810ca8fb93444d4529e to your computer and use it in GitHub Desktop.
Save wadez/17ef156078381810ca8fb93444d4529e to your computer and use it in GitHub Desktop.
while (...) {
var id = pool.pop();
promises.push(new Promise((...) => {
...
const halt = (reason) => {
pool.push(id)
reject(reason)
}
...
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment