Unordered Parallel Execution
Learn how to parallelize execution by implementing a URL status monitoring application.
We'll cover the following...
We just saw that streams process each data chunk in sequence, but sometimes, this can be a bottleneck because it won’t let us make the most of the concurrency of Node.js. If we have to execute a slow asynchronous operation for every data chunk, it can be advantageous to parallelize the execution and speed up the overall process. Of course, this pattern can only be applied if there’s no relationship between each chunk of data, which might happen frequently for object streams, but very rarely for binary streams.
Caution: Unordered parallel streams can’t be used when the order in which the data is processed is important.
Let’s see ...