doc: Clarify advisory-ness of stream._read() argument

pull/24507/merge
isaacs 2013-03-01 14:26:35 -08:00
parent 13c8bc8917
commit fc22986023
1 changed files with 7 additions and 0 deletions

View File

@ -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