Chapter 5 limited parallel execution -> process.nextTick usage #78
Unanswered
HowToDisappear
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello guys! I have a question about "spider" code logic that you have in Chapter 5 -> limited parallel execution. I don't understand the usage of process.nextTick(this.next.bind(this)). I mean I understand in principle what it does - it moves callback execution to the next event loop run. I also read Chapter 3 about unleashing Zalgo and it was easy to understand - you postponed code execution to timely set up event listeners. But in this particular case I don't understand why is it used and what could go wrong if we were calling this.next synchronously.
TaskQueue.js
Spider.js
Beta Was this translation helpful? Give feedback.
All reactions