Chapter(4):Why do we need to defer calling next() in task callback? #33
Unanswered
thetnaingtn
asked this question in
Q&A
Replies: 1 comment
-
I think the next() is deferred because its a callback to get called when we have still task in the queue |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In Chapter(4) Limiting concurrency
In the next method of TaskQueue class, in the callback which is passed to task() function, why next() function call is deferred to the next circle. Can somebody please tell me why?
task(()=>{ this.running-- process.nextTick(this.next.bind(this)) //why do we need to defer calling next function ? })
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions