Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

doc: found better use-case for using `rstream.unshift` #5177

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

In the example before unshift() does the same as push() we are anyway
having managing the first chunk. But by using the unshift() on the source
we have can reread our chunk (now as body) on the next readable event.
Source: https://groups.google.com/forum/?fromgroups=#!topic/nodejs/hTA91YugVAk

bodokaiser doc: found better use-case for using `rstream.unshift`
In the example before `unshift()` does the same as `push()` we are anyway
having managing the first chunk. But by using the `unshift()` on the source
we have can reread our chunk (now as body) on the next `readable` event.
Source: https://groups.google.com/forum/?fromgroups=#!topic/nodejs/hTA91YugVAk
5585bfd

isaacs commented Apr 1, 2013

The problem here is that, in the example, we don't know that the source is an instanceof Readable, or just a stream-like data emitter.

@isaacs isaacs closed this Apr 1, 2013

@richardlau richardlau pushed a commit to ibmruntimes/node that referenced this pull request Jun 17, 2016

@AndreasMadsen @MylesBorins AndreasMadsen + MylesBorins benchmark: move string-decoder to its own category
PR-URL: #5177
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
38e9f65

@richardlau richardlau pushed a commit to ibmruntimes/node that referenced this pull request Jun 29, 2016

@AndreasMadsen @MylesBorins AndreasMadsen + MylesBorins benchmark: move string-decoder to its own category
PR-URL: #5177
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
58ad451
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment