...

/

Untitled Masterpiece

Learn how to implement limited parallel execution flow using streams.

The parallel streams that we created previously may shuffle the order of the emitted data, but there are situations where this is not acceptable. Sometimes, in fact, it’s necessary to have each chunk emitted in the same order in which it was received. However, we can still run the transform function in parallel; all we have to do is sort the data emitted by each task so that it follows the same order in which the data was received.

This technique involves the use of a buffer to reorder the chunks while ...