PacktPublishing/Node.js-Design-Patterns-Third-Edition

Question on 11-asyncawait-web-spider-v4

jcplerm opened this issue · 2 comments

Hope you don't mind asking questions about your new book (Node.js Design Patterns)...
Don't know another way of reaching out to you.
Node.js processing model is all new to me, and my mind is bent while trying to follow the examples, especially the one here:

https://github.com/PacktPublishing/Node.js-Design-Patterns-Third-Edition/tree/master/05-asynchronous-control-flow-patterns-with-promises-and-async-await/11-asyncawait-web-spider-v4

In file TaskQueuePC.js, line 44, the consumer function is invoked by passing "taskWrapper" as the argument.
However, line 12 defines the consumer() function without any arguments.
I can't see how the consumer function would as defined in line 12 relates to how it's invoked in line 44.

Thanks,

Julius Lerm
Chicago, IL

Having devoted more time to study the code, I think I understand what's going on.
You may close this issue.

Hello @jcplerm, sorry for the delay in getting back to you. I am glad to see that you eventually managed to understand the example. In any case, feel free to ask more questions along your journey through Node.js Design Patterns. GitHub is a good place for this, so feel free to open more issues as needed :)