Sequential Execution: Web Spider Version 2
Explore how to manage asynchronous control flow in Node.js by implementing sequential execution patterns. Understand how to run tasks in order, handle recursive downloads in a web spider, and dynamically iterate over collections with callbacks to maintain execution order and data flow in asynchronous programs.
We'll cover the following...
In this section, we’ll look at asynchronous control flow patterns and start by analyzing the sequential execution flow.
Executing a set of tasks in sequence means running them one at a time, one after the other. The order of execution matters and must be preserved, because the result of a task in the list may affect the execution of the next. The illustration given below shows this concept:
There are different variations of this flow:
Executing a set of known tasks in sequence, without propagating data across them. ...