Reading large amounts of data

The previous example emitted events for every line read. This approach doesn't scale as well when you're dealing with larger volumes of input data. For example, what if many lines were read? Shouldn't you process these at the same time? The first step is listening to the data event on the readable stream instead of using the readline module.

The file we'll use as input for these examples will be the standard words file that's found in one place or another on Unix systems. This gives us ~235,000 lines to work with.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.211.66