<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/node.git/test/simple/test-stream2-read-sync-stack.js, branch move-debugger-tests</title>
<subtitle>github.com: joyent/node.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/'/>
<entry>
<title>stream: There is no _read cb, there is only push</title>
<updated>2013-03-01T01:38:17+00:00</updated>
<author>
<name>isaacs</name>
<email>i@izs.me</email>
</author>
<published>2013-02-28T23:32:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=88644eaa2db3e9b603efca00e640ff08d9320c1b'/>
<id>88644eaa2db3e9b603efca00e640ff08d9320c1b</id>
<content type='text'>
This makes it so that `stream.push(chunk)` is the only way to signal the
end of reading, removing the confusing disparity between the
callback-style _read method, and the fact that most real-world streams
do not have a 1:1 corollation between the "please give me data" event,
and the actual arrival of a chunk of data.

It is still possible, of course, to implement a `CallbackReadable` on
top of this.  Simply provide a method like this as the callback:

    function readCallback(er, chunk) {
      if (er)
        stream.emit('error', er);
      else
        stream.push(chunk);
    }

However, *only* fs streams actually would behave in this way, so it
makes not a lot of sense to make TCP, TLS, HTTP, and all the rest have
to bend into this uncomfortable paradigm.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes it so that `stream.push(chunk)` is the only way to signal the
end of reading, removing the confusing disparity between the
callback-style _read method, and the fact that most real-world streams
do not have a 1:1 corollation between the "please give me data" event,
and the actual arrival of a chunk of data.

It is still possible, of course, to implement a `CallbackReadable` on
top of this.  Simply provide a method like this as the callback:

    function readCallback(er, chunk) {
      if (er)
        stream.emit('error', er);
      else
        stream.push(chunk);
    }

However, *only* fs streams actually would behave in this way, so it
makes not a lot of sense to make TCP, TLS, HTTP, and all the rest have
to bend into this uncomfortable paradigm.
</pre>
</div>
</content>
</entry>
<entry>
<title>streams2: Handle sync read callbacks nicely</title>
<updated>2013-01-24T15:49:27+00:00</updated>
<author>
<name>isaacs</name>
<email>i@izs.me</email>
</author>
<published>2013-01-24T01:52:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=782149ddc3c7a0ab8e72ad8afc3eb891ea0a6aef'/>
<id>782149ddc3c7a0ab8e72ad8afc3eb891ea0a6aef</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
