New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc,stream: remove wrong remark on readable.read #15014

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
6 participants
@jscissr
Contributor

jscissr commented Aug 24, 2017

The returned chunk is never longer than size, if I read the code correctly. I even tested it:

const stream = require('stream')

const readable = new stream.Readable({
  read (size) {
    this.push(Buffer.from('0123456789'))
    this.push(null)
  }
})

readable.on('readable', () => {
  let buf
  while ((buf = readable.read(4))) {
    console.log(buf)
  }
})

Output:

<Buffer 30 31 32 33>
<Buffer 34 35 36 37>
<Buffer 38 39>

Even tough the stream has ended, the data returned does not exceed size bytes.

Checklist
Affected core subsystem(s)

stream

@jasnell jasnell requested a review from mcollina Aug 24, 2017

@mcollina

LGTM without the spurious changes.

doc,stream: remove wrong remark on readable.read
The returned chunk is *never* longer than `size`.
@jscissr

This comment has been minimized.

Show comment
Hide comment
@jscissr

jscissr Aug 24, 2017

Contributor

Did a rebase now.

Contributor

jscissr commented Aug 24, 2017

Did a rebase now.

@lpinca

lpinca approved these changes Aug 25, 2017

jasnell added a commit that referenced this pull request Aug 25, 2017

doc,stream: remove wrong remark on readable.read
The returned chunk is *never* longer than `size`.

PR-URL: #15014
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@jasnell

This comment has been minimized.

Show comment
Hide comment
@jasnell

jasnell Aug 25, 2017

Member

Landed in 8987ae8

Member

jasnell commented Aug 25, 2017

Landed in 8987ae8

@jasnell jasnell closed this Aug 25, 2017

@jscissr jscissr deleted the jscissr:patch-1 branch Aug 30, 2017

oe added a commit to ayojs/ayo that referenced this pull request Aug 30, 2017

doc,stream: remove wrong remark on readable.read
The returned chunk is *never* longer than `size`.

PR-URL: nodejs/node#15014
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>

oe added a commit to ayojs/ayo that referenced this pull request Aug 30, 2017

doc,stream: remove wrong remark on readable.read
The returned chunk is *never* longer than `size`.

PR-URL: nodejs/node#15014
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>

MylesBorins added a commit that referenced this pull request Sep 10, 2017

doc,stream: remove wrong remark on readable.read
The returned chunk is *never* longer than `size`.

PR-URL: #15014
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>

@MylesBorins MylesBorins referenced this pull request Sep 10, 2017

Merged

v8.5.0 proposal #15308

MylesBorins added a commit that referenced this pull request Sep 12, 2017

doc,stream: remove wrong remark on readable.read
The returned chunk is *never* longer than `size`.

PR-URL: #15014
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>

MylesBorins added a commit that referenced this pull request Sep 20, 2017

doc,stream: remove wrong remark on readable.read
The returned chunk is *never* longer than `size`.

PR-URL: #15014
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>

@MylesBorins MylesBorins referenced this pull request Sep 20, 2017

Merged

v6.11.4 proposal #15506

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment