summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2013-03-01 14:26:35 -0800
committerisaacs <i@izs.me>2013-03-01 14:26:35 -0800
commitfc2298602323530bda9efa75f61dfb0e6433b401 (patch)
treefbb8f81a931faada4072a37fae67593ff1c864dc /doc
parent13c8bc8917a152487110b734680af631dfdae59c (diff)
downloadandroid-node-v8-fc2298602323530bda9efa75f61dfb0e6433b401.tar.gz
android-node-v8-fc2298602323530bda9efa75f61dfb0e6433b401.tar.bz2
android-node-v8-fc2298602323530bda9efa75f61dfb0e6433b401.zip
doc: Clarify advisory-ness of stream._read() argument
Diffstat (limited to 'doc')
-rw-r--r--doc/api/stream.markdown7
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/api/stream.markdown b/doc/api/stream.markdown
index a30eea3def..ef4848c2ef 100644
--- a/doc/api/stream.markdown
+++ b/doc/api/stream.markdown
@@ -127,6 +127,13 @@ When data is available, put it into the read queue by calling
reading. When `_read` is called again, you should start pushing more
data.
+The `size` argument is advisory. Implementations where a "read" is a
+single call that returns data can use this to know how much data to
+fetch. Implementations where that is not relevant, such as TCP or
+TLS, may ignore this argument, and simply provide data whenever it
+becomes available. There is no need, for example to "wait" until
+`size` bytes are available before calling `stream.push(chunk)`.
+
### readable.push(chunk)
* `chunk` {Buffer | null | String} Chunk of data to push into the read queue