Last active
September 8, 2018 10:00
-
-
Save wilk/ad9b8fe1f2e365787e5aea66ae32cb9c to your computer and use it in GitHub Desktop.
microjob context example
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
const counter = 1000000 | |
const res = await job(() => { | |
let i = 0 | |
for (i = 0; i < counter; i++) {} | |
return i | |
}, {ctx: {counter}}) | |
console.log(res) // 1000000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment