Created
June 13, 2021 17:36
-
-
Save wadez/87208d64b732a949e253236bef1ca206 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while (...) { | |
promises.push(new Promise((...) => { | |
... | |
const halt = (reason) => { | |
fatalPromises.push(new Promise((...) => { | |
Promise.allSettled(workers.map(w => w.terminate())) | |
.then(() => { | |
resolve2(reason) | |
}) | |
})) | |
reject() | |
} | |
... | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment