Skip to content

Instantly share code, notes, and snippets.

@wilk
Created September 8, 2018 10:03
Show Gist options
  • Save wilk/846236aaa477e1c7364e5810885707e4 to your computer and use it in GitHub Desktop.
Save wilk/846236aaa477e1c7364e5810885707e4 to your computer and use it in GitHub Desktop.
microjob async example
const res = await job(async () => {
let i = 0
for (i = 0; i < 1000000; i++) {
for (let j = 0; j < 1000000; j++) {
for (let k = 0; k < 1000000; k++) {
await http.get('www.google.it')
}
}
}
return i
})
console.log(res) // 1000000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment