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

streams: remove all references to readableState/writableState from docs #12855

Closed
wants to merge 7 commits into
base: master
from

Conversation

@calvinmetcalf
Member

calvinmetcalf commented May 5, 2017

This removes all the refereces to readableState and writableState from the
docs by adding some computed properties to allow for the same functionality
that was exposed by the use of readableState and writableState.

We add writeBuffer and readBuffer getters for the state buffers and
we have a flowing getter for readableState.flowing, I also add a
._setFlowing for the internal places we need to set the flowing state.

Part of the readableState/writableState mega issue #445.
Fixes #6799.

cc @nodejs/streams

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

streams

(edit @mcollina: added link to a open bug on this)

@mscdex

This comment has been minimized.

Show comment
Hide comment
@mscdex

mscdex May 5, 2017

Contributor

There could be a problem with adding a non-underscore-prefixed property to all Readable instances (e.g. readBuffer, flowing, etc.). Have you at least ran CITGM on such changes?

I could easily see (network) protocol implementors using names such as readBuffer and writeBuffer on their stream instances. This is why having just a single property (e.g. _readableState) for accessing stream state is better because it means less potential collisions with custom stream objects.

Contributor

mscdex commented May 5, 2017

There could be a problem with adding a non-underscore-prefixed property to all Readable instances (e.g. readBuffer, flowing, etc.). Have you at least ran CITGM on such changes?

I could easily see (network) protocol implementors using names such as readBuffer and writeBuffer on their stream instances. This is why having just a single property (e.g. _readableState) for accessing stream state is better because it means less potential collisions with custom stream objects.

@mscdex mscdex added in progress and removed in progress labels May 5, 2017

@mscdex

This comment has been minimized.

Show comment
Hide comment
@mscdex

mscdex May 5, 2017

Contributor

The commit description is a bit misleading, it sounds like it's only making docs changes or making code changes just to change docs in various ways (except I'm guessing the code changes are instead really meant to provide a more stable interface for stream state?).

Contributor

mscdex commented May 5, 2017

The commit description is a bit misleading, it sounds like it's only making docs changes or making code changes just to change docs in various ways (except I'm guessing the code changes are instead really meant to provide a more stable interface for stream state?).

@mscdex

This comment has been minimized.

Show comment
Hide comment
@mscdex

mscdex May 5, 2017

Contributor

Also, as with #12860, is performance impacted by these changes?

Contributor

mscdex commented May 5, 2017

Also, as with #12860, is performance impacted by these changes?

@Fishrock123 Fishrock123 added this to Work In Progress / Has PR in Streams: _readableState and _writableState May 5, 2017

@mcollina

This comment has been minimized.

Show comment
Hide comment
@mcollina

mcollina May 11, 2017

Member

I will run the benchmarks of the relevant subsystems when I get back.

Member

mcollina commented May 11, 2017

I will run the benchmarks of the relevant subsystems when I get back.

@mcollina

This comment has been minimized.

Show comment
Hide comment
@mcollina

mcollina May 16, 2017

Member

@mscdex how much time the benchmarks should run? I'm 8 hours in the benchmark/compare.js http benchmark, and it's still at 31%. Do you want to see something specific?

Member

mcollina commented May 16, 2017

@mscdex how much time the benchmarks should run? I'm 8 hours in the benchmark/compare.js http benchmark, and it's still at 31%. Do you want to see something specific?

@mscdex

This comment has been minimized.

Show comment
Hide comment
@mscdex

mscdex May 16, 2017

Contributor

@mcollina I don't believe the existing benchmarks will exercise the (http) code paths changed by this PR. Specifically, it looks like connect/upgrade http requests need to be sent/received with listeners for those events added. Might need to craft a new little benchmark to test this scenario.

Contributor

mscdex commented May 16, 2017

@mcollina I don't believe the existing benchmarks will exercise the (http) code paths changed by this PR. Specifically, it looks like connect/upgrade http requests need to be sent/received with listeners for those events added. Might need to craft a new little benchmark to test this scenario.

@mcollina

This comment has been minimized.

Show comment
Hide comment
@mcollina

mcollina May 16, 2017

Member

benchmarks from net:

$ cat compare-remove-access-net.csv | Rscript benchmark/compare.R
                                                   improvement confidence    p.value
 net/net-c2s-cork.js dur=5 type="buf" len=1024         -0.64 %            0.12929603
 net/net-c2s-cork.js dur=5 type="buf" len=128           0.06 %            0.86520957
 net/net-c2s-cork.js dur=5 type="buf" len=16           -0.24 %            0.27783431
 net/net-c2s-cork.js dur=5 type="buf" len=32           -0.01 %            0.94641307
 net/net-c2s-cork.js dur=5 type="buf" len=4             0.08 %            0.65879417
 net/net-c2s-cork.js dur=5 type="buf" len=512          -0.20 %            0.59834906
 net/net-c2s-cork.js dur=5 type="buf" len=64           -0.13 %            0.62751004
 net/net-c2s-cork.js dur=5 type="buf" len=8             0.01 %            0.96812210
 net/net-c2s.js dur=5 type="asc" len=102400             0.83 %            0.06647777
 net/net-c2s.js dur=5 type="asc" len=16777216          -0.20 %            0.38523291
 net/net-c2s.js dur=5 type="buf" len=102400            -0.23 %            0.51936416
 net/net-c2s.js dur=5 type="buf" len=16777216           0.15 %            0.59419811
 net/net-c2s.js dur=5 type="utf" len=102400             0.08 %            0.88572038
 net/net-c2s.js dur=5 type="utf" len=16777216           0.16 %            0.40569601
 net/net-pipe.js dur=5 type="asc" len=102400            0.62 %            0.22726849
 net/net-pipe.js dur=5 type="asc" len=16777216         -0.38 %            0.35615455
 net/net-pipe.js dur=5 type="buf" len=102400           -0.14 %            0.71665559
 net/net-pipe.js dur=5 type="buf" len=16777216          0.14 %            0.65102610
 net/net-pipe.js dur=5 type="utf" len=102400            0.24 %            0.67870301
 net/net-pipe.js dur=5 type="utf" len=16777216         -0.31 %            0.22689837
 net/net-s2c.js dur=5 type="asc" len=102400             0.29 %            0.48483245
 net/net-s2c.js dur=5 type="asc" len=16777216          -0.07 %            0.72761635
 net/net-s2c.js dur=5 type="buf" len=102400             0.01 %            0.95935582
 net/net-s2c.js dur=5 type="buf" len=16777216           0.02 %            0.94113175
 net/net-s2c.js dur=5 type="utf" len=102400             0.02 %            0.98168133
 net/net-s2c.js dur=5 type="utf" len=16777216           0.15 %            0.45777973
 net/tcp-raw-c2s.js dur=5 type="asc" len=102400         0.67 %            0.12001540
 net/tcp-raw-c2s.js dur=5 type="asc" len=16777216      -0.05 %            0.70525192
 net/tcp-raw-c2s.js dur=5 type="buf" len=102400         0.97 %            0.06538486
 net/tcp-raw-c2s.js dur=5 type="buf" len=16777216       0.15 %            0.46833092
 net/tcp-raw-c2s.js dur=5 type="utf" len=102400         0.78 %            0.27088741
 net/tcp-raw-c2s.js dur=5 type="utf" len=16777216      -0.11 %            0.42554888
 net/tcp-raw-pipe.js dur=5 type="asc" len=102400       -2.02 %            0.62683795
 net/tcp-raw-pipe.js dur=5 type="asc" len=16777216     -3.46 %            0.27002966
 net/tcp-raw-pipe.js dur=5 type="buf" len=102400       -3.53 %            0.40890117
 net/tcp-raw-pipe.js dur=5 type="buf" len=16777216     -4.60 %            0.10957039
 net/tcp-raw-pipe.js dur=5 type="utf" len=102400       -3.05 %            0.47004913
 net/tcp-raw-pipe.js dur=5 type="utf" len=16777216     -3.83 %            0.26013753
 net/tcp-raw-s2c.js dur=5 type="asc" len=102400         0.64 %            0.14627038
 net/tcp-raw-s2c.js dur=5 type="asc" len=16777216      -0.14 %            0.36022011
 net/tcp-raw-s2c.js dur=5 type="buf" len=102400         0.19 %            0.40813902
 net/tcp-raw-s2c.js dur=5 type="buf" len=16777216      -0.04 %            0.92686921
 net/tcp-raw-s2c.js dur=5 type="utf" len=102400        -0.31 %            0.58679716
 net/tcp-raw-s2c.js dur=5 type="utf" len=16777216      -0.11 %            0.56693651

Benchmarks for streams:

                                          improvement confidence    p.value
 streams/readable-bigread.js n=1000            0.14 %            0.89385560
 streams/readable-bigunevenread.js n=1000     -0.16 %            0.41762734
 streams/readable-boundaryread.js n=2000      -0.04 %            0.83768171
 streams/readable-readall.js n=5000           -0.20 %            0.49418135
 streams/readable-unevenread.js n=1000         0.30 %            0.45258734
 streams/writable-manywrites.js n=2000000     -1.02 %          * 0.03359655

It seems there is no downside for this patch, even though it is definitely making it more complicated for the engine.

@mscdex can we copy-and-past an existing one and add a listener? I'm not entirely familiar with that code path. It's exercised for websockets I presume. Anyway, I do not think it will cause anything more that what we saw.

Member

mcollina commented May 16, 2017

benchmarks from net:

$ cat compare-remove-access-net.csv | Rscript benchmark/compare.R
                                                   improvement confidence    p.value
 net/net-c2s-cork.js dur=5 type="buf" len=1024         -0.64 %            0.12929603
 net/net-c2s-cork.js dur=5 type="buf" len=128           0.06 %            0.86520957
 net/net-c2s-cork.js dur=5 type="buf" len=16           -0.24 %            0.27783431
 net/net-c2s-cork.js dur=5 type="buf" len=32           -0.01 %            0.94641307
 net/net-c2s-cork.js dur=5 type="buf" len=4             0.08 %            0.65879417
 net/net-c2s-cork.js dur=5 type="buf" len=512          -0.20 %            0.59834906
 net/net-c2s-cork.js dur=5 type="buf" len=64           -0.13 %            0.62751004
 net/net-c2s-cork.js dur=5 type="buf" len=8             0.01 %            0.96812210
 net/net-c2s.js dur=5 type="asc" len=102400             0.83 %            0.06647777
 net/net-c2s.js dur=5 type="asc" len=16777216          -0.20 %            0.38523291
 net/net-c2s.js dur=5 type="buf" len=102400            -0.23 %            0.51936416
 net/net-c2s.js dur=5 type="buf" len=16777216           0.15 %            0.59419811
 net/net-c2s.js dur=5 type="utf" len=102400             0.08 %            0.88572038
 net/net-c2s.js dur=5 type="utf" len=16777216           0.16 %            0.40569601
 net/net-pipe.js dur=5 type="asc" len=102400            0.62 %            0.22726849
 net/net-pipe.js dur=5 type="asc" len=16777216         -0.38 %            0.35615455
 net/net-pipe.js dur=5 type="buf" len=102400           -0.14 %            0.71665559
 net/net-pipe.js dur=5 type="buf" len=16777216          0.14 %            0.65102610
 net/net-pipe.js dur=5 type="utf" len=102400            0.24 %            0.67870301
 net/net-pipe.js dur=5 type="utf" len=16777216         -0.31 %            0.22689837
 net/net-s2c.js dur=5 type="asc" len=102400             0.29 %            0.48483245
 net/net-s2c.js dur=5 type="asc" len=16777216          -0.07 %            0.72761635
 net/net-s2c.js dur=5 type="buf" len=102400             0.01 %            0.95935582
 net/net-s2c.js dur=5 type="buf" len=16777216           0.02 %            0.94113175
 net/net-s2c.js dur=5 type="utf" len=102400             0.02 %            0.98168133
 net/net-s2c.js dur=5 type="utf" len=16777216           0.15 %            0.45777973
 net/tcp-raw-c2s.js dur=5 type="asc" len=102400         0.67 %            0.12001540
 net/tcp-raw-c2s.js dur=5 type="asc" len=16777216      -0.05 %            0.70525192
 net/tcp-raw-c2s.js dur=5 type="buf" len=102400         0.97 %            0.06538486
 net/tcp-raw-c2s.js dur=5 type="buf" len=16777216       0.15 %            0.46833092
 net/tcp-raw-c2s.js dur=5 type="utf" len=102400         0.78 %            0.27088741
 net/tcp-raw-c2s.js dur=5 type="utf" len=16777216      -0.11 %            0.42554888
 net/tcp-raw-pipe.js dur=5 type="asc" len=102400       -2.02 %            0.62683795
 net/tcp-raw-pipe.js dur=5 type="asc" len=16777216     -3.46 %            0.27002966
 net/tcp-raw-pipe.js dur=5 type="buf" len=102400       -3.53 %            0.40890117
 net/tcp-raw-pipe.js dur=5 type="buf" len=16777216     -4.60 %            0.10957039
 net/tcp-raw-pipe.js dur=5 type="utf" len=102400       -3.05 %            0.47004913
 net/tcp-raw-pipe.js dur=5 type="utf" len=16777216     -3.83 %            0.26013753
 net/tcp-raw-s2c.js dur=5 type="asc" len=102400         0.64 %            0.14627038
 net/tcp-raw-s2c.js dur=5 type="asc" len=16777216      -0.14 %            0.36022011
 net/tcp-raw-s2c.js dur=5 type="buf" len=102400         0.19 %            0.40813902
 net/tcp-raw-s2c.js dur=5 type="buf" len=16777216      -0.04 %            0.92686921
 net/tcp-raw-s2c.js dur=5 type="utf" len=102400        -0.31 %            0.58679716
 net/tcp-raw-s2c.js dur=5 type="utf" len=16777216      -0.11 %            0.56693651

Benchmarks for streams:

                                          improvement confidence    p.value
 streams/readable-bigread.js n=1000            0.14 %            0.89385560
 streams/readable-bigunevenread.js n=1000     -0.16 %            0.41762734
 streams/readable-boundaryread.js n=2000      -0.04 %            0.83768171
 streams/readable-readall.js n=5000           -0.20 %            0.49418135
 streams/readable-unevenread.js n=1000         0.30 %            0.45258734
 streams/writable-manywrites.js n=2000000     -1.02 %          * 0.03359655

It seems there is no downside for this patch, even though it is definitely making it more complicated for the engine.

@mscdex can we copy-and-past an existing one and add a listener? I'm not entirely familiar with that code path. It's exercised for websockets I presume. Anyway, I do not think it will cause anything more that what we saw.

@mcollina

Some nits

Show outdated Hide outdated lib/_http_server.js Outdated
Show outdated Hide outdated lib/_stream_duplex.js Outdated
Show outdated Hide outdated lib/_stream_readable.js Outdated
Show outdated Hide outdated lib/_stream_writable.js Outdated
@mscdex

This comment has been minimized.

Show comment
Hide comment
@mscdex

mscdex May 16, 2017

Contributor

@mcollina I don't think the net changes are really worth worrying about since they are not hot paths. One requires setting the pauseOnCreate option when connecting a socket and the other requires accessing socket.bytesWritten.

The streams changes should not be affected at all because they do not utilize the new getters/setters themselves.

As far as creating a new http benchmark for this, you might be able to use an existing connect/upgrade test as a guide.

Contributor

mscdex commented May 16, 2017

@mcollina I don't think the net changes are really worth worrying about since they are not hot paths. One requires setting the pauseOnCreate option when connecting a socket and the other requires accessing socket.bytesWritten.

The streams changes should not be affected at all because they do not utilize the new getters/setters themselves.

As far as creating a new http benchmark for this, you might be able to use an existing connect/upgrade test as a guide.

Show outdated Hide outdated lib/net.js Outdated
@calvinmetcalf

This comment has been minimized.

Show comment
Hide comment
@calvinmetcalf

calvinmetcalf May 16, 2017

Member

ok updated with changes readBuffer and writeBuffer become readableBuffer and writableBuffer, also broke it up into separate commits for the separate subsystems

Member

calvinmetcalf commented May 16, 2017

ok updated with changes readBuffer and writeBuffer become readableBuffer and writableBuffer, also broke it up into separate commits for the separate subsystems

@mcollina

LGTM

@calvinmetcalf are you adding the benchmark as well?

@calvinmetcalf

This comment has been minimized.

Show comment
Hide comment
@calvinmetcalf

calvinmetcalf May 17, 2017

Member

@mcollina I'm not super familiar with benchmarks so I can if somebody wants to walk me through it

Member

calvinmetcalf commented May 17, 2017

@mcollina I'm not super familiar with benchmarks so I can if somebody wants to walk me through it

@mcollina

This comment has been minimized.

Show comment
Hide comment
@mcollina

mcollina May 17, 2017

Member

This PR cause no regression in the upgrade path, however that has a regression even in master to v6.

$ cat compare-pr-12855.csv | Rscript benchmark/compare.R
                        improvement confidence   p.value
 http/upgrade.js n=1000     -1.96 %            0.8006479
 http/upgrade.js n=5        -0.55 %            0.8759959

The benchmark code:

'use strict';

const common = require('../common.js');
const PORT = common.PORT;
const net = require('net');

const bench = common.createBenchmark(main, {
  n: [5, 1000]
});

const reqData = 'GET / HTTP/1.1\r\n' +
  'Upgrade: WebSocket\r\n' +
  'Connection: Upgrade\r\n' +
  '\r\n' +
  'WjN}|M(6';

const resData = 'HTTP/1.1 101 Web Socket Protocol Handshake\r\n' +
  'Upgrade: WebSocket\r\n' +
  'Connection: Upgrade\r\n' +
  '\r\n\r\n';

function main(conf) {
  process.env.PORT = PORT;
  var server = require('../fixtures/simple-http-server.js')
  .listen(process.env.PORT || common.PORT)
  .on('listening', function() {
    bench.start()
    doBench(server.address(), +conf.n, function() {
      bench.end(+conf.n);
      server.close();
    });
  })
  .on('upgrade', function(req, socket, upgradeHead) {
    socket.resume();
    socket.write(resData);
    socket.end();
  })
}

function doBench(address, count, done) {
  if (count === 0) {
    done()
    return
  }

  const conn = net.createConnection(address.port);
  conn.write(reqData);
  conn.resume()

  conn.on('end', function() {
    doBench(address, count - 1, done);
  });
}
Member

mcollina commented May 17, 2017

This PR cause no regression in the upgrade path, however that has a regression even in master to v6.

$ cat compare-pr-12855.csv | Rscript benchmark/compare.R
                        improvement confidence   p.value
 http/upgrade.js n=1000     -1.96 %            0.8006479
 http/upgrade.js n=5        -0.55 %            0.8759959

The benchmark code:

'use strict';

const common = require('../common.js');
const PORT = common.PORT;
const net = require('net');

const bench = common.createBenchmark(main, {
  n: [5, 1000]
});

const reqData = 'GET / HTTP/1.1\r\n' +
  'Upgrade: WebSocket\r\n' +
  'Connection: Upgrade\r\n' +
  '\r\n' +
  'WjN}|M(6';

const resData = 'HTTP/1.1 101 Web Socket Protocol Handshake\r\n' +
  'Upgrade: WebSocket\r\n' +
  'Connection: Upgrade\r\n' +
  '\r\n\r\n';

function main(conf) {
  process.env.PORT = PORT;
  var server = require('../fixtures/simple-http-server.js')
  .listen(process.env.PORT || common.PORT)
  .on('listening', function() {
    bench.start()
    doBench(server.address(), +conf.n, function() {
      bench.end(+conf.n);
      server.close();
    });
  })
  .on('upgrade', function(req, socket, upgradeHead) {
    socket.resume();
    socket.write(resData);
    socket.end();
  })
}

function doBench(address, count, done) {
  if (count === 0) {
    done()
    return
  }

  const conn = net.createConnection(address.port);
  conn.write(reqData);
  conn.resume()

  conn.on('end', function() {
    doBench(address, count - 1, done);
  });
}
@calvinmetcalf

This comment has been minimized.

Show comment
Hide comment
@calvinmetcalf

calvinmetcalf May 17, 2017

Member

ok added the benchmark

Member

calvinmetcalf commented May 17, 2017

ok added the benchmark

@mcollina

This comment has been minimized.

Show comment
Hide comment
@calvinmetcalf

This comment has been minimized.

Show comment
Hide comment
@calvinmetcalf

calvinmetcalf May 18, 2017

Member

fixed the failing test

Member

calvinmetcalf commented May 18, 2017

fixed the failing test

@mcollina

This comment has been minimized.

Show comment
Hide comment
@mcollina

mcollina May 18, 2017

Member

@mscdex can you have a look at this one?

Also @nodejs/streams.

Member

mcollina commented May 18, 2017

@mscdex can you have a look at this one?

Also @nodejs/streams.

Show outdated Hide outdated doc/api/stream.md Outdated
@mscdex

This comment has been minimized.

Show comment
Hide comment
@mscdex

mscdex May 18, 2017

Contributor

I'm still not enthusiastic about adding a bunch of new properties, although readableBuffer and writableBuffer are better than the previous names. Would it be possible to just prefix the type for all of the extracted property names (e.g. readableFlowing) so as to both further "namespace" them and avoid potential collisions with userland and to make it clear what property is valid for what without having to root through the docs? Additionally it might be good to have input from @ChALkeR about how common some of these new properties are in the wild...

Contributor

mscdex commented May 18, 2017

I'm still not enthusiastic about adding a bunch of new properties, although readableBuffer and writableBuffer are better than the previous names. Would it be possible to just prefix the type for all of the extracted property names (e.g. readableFlowing) so as to both further "namespace" them and avoid potential collisions with userland and to make it clear what property is valid for what without having to root through the docs? Additionally it might be good to have input from @ChALkeR about how common some of these new properties are in the wild...

@mcollina

This comment has been minimized.

Show comment
Hide comment
@mcollina

mcollina May 19, 2017

Member

I'm 👍 with readableFlowing.

I think most of those are prefixed now, but we'll check for each PR. This tackles stuff that we list in the docs, as it's hard to understand the stream state machine without them.

Member

mcollina commented May 19, 2017

I'm 👍 with readableFlowing.

I think most of those are prefixed now, but we'll check for each PR. This tackles stuff that we list in the docs, as it's hard to understand the stream state machine without them.

@mcollina

This comment has been minimized.

Show comment
Hide comment
@mcollina

mcollina Dec 11, 2017

Member

I have addressed the various nits.

I've added the semver-minor tag as it's adding new functionality.

@BridgeAR @jasnell please get another pass.

@calvinmetcalf @nodejs/streams ?

Member

mcollina commented Dec 11, 2017

I have addressed the various nits.

I've added the semver-minor tag as it's adding new functionality.

@BridgeAR @jasnell please get another pass.

@calvinmetcalf @nodejs/streams ?

@mcollina

This comment has been minimized.

Show comment
Hide comment
@mcollina

mcollina Dec 12, 2017

Member

Ava tests are failing. Running CITGM on master to check if there are differences: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/1145/.

Member

mcollina commented Dec 12, 2017

Ava tests are failing. Running CITGM on master to check if there are differences: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/1145/.

@apapirovski

This comment has been minimized.

Show comment
Hide comment
@apapirovski

apapirovski Dec 12, 2017

Member

There was a domain-related PR that broke it. Here's the fix which needs some approvals: #17588

Member

apapirovski commented Dec 12, 2017

There was a domain-related PR that broke it. Here's the fix which needs some approvals: #17588

@mcollina

This comment has been minimized.

Show comment
Hide comment
@mcollina

mcollina Dec 15, 2017

Member

CITGM seems clear, landing

Member

mcollina commented Dec 15, 2017

CITGM seems clear, landing

@mcollina

This comment has been minimized.

Show comment
Hide comment
@mcollina

mcollina Dec 15, 2017

Member

Landed as e20af33.

Member

mcollina commented Dec 15, 2017

Landed as e20af33.

@mcollina mcollina closed this Dec 15, 2017

@mcollina mcollina deleted the calvinmetcalf:rm-readable-state-docs branch Dec 15, 2017

mcollina added a commit that referenced this pull request Dec 15, 2017

stream: add flow and buffer properties to streams
This adds computed properties to readable and writable streams to
allow access to the readable buffer, the writable buffer, and flow
state without accessing the readable or writable state.

These are the only uses of readable and writable state in the docs
so adding these work arounds allows them to be removed from the docs.

This also updates net, http_client and http_server to use the new
methods instead of manipulating readable and writable state directly.

See: #445
PR-URL: #12855
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>

@addaleax addaleax removed the author ready label Dec 29, 2017

MylesBorins added a commit that referenced this pull request Jan 8, 2018

stream: add flow and buffer properties to streams
This adds computed properties to readable and writable streams to
allow access to the readable buffer, the writable buffer, and flow
state without accessing the readable or writable state.

These are the only uses of readable and writable state in the docs
so adding these work arounds allows them to be removed from the docs.

This also updates net, http_client and http_server to use the new
methods instead of manipulating readable and writable state directly.

See: #445
PR-URL: #12855
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>

MylesBorins added a commit that referenced this pull request Jan 9, 2018

stream: add flow and buffer properties to streams
This adds computed properties to readable and writable streams to
allow access to the readable buffer, the writable buffer, and flow
state without accessing the readable or writable state.

These are the only uses of readable and writable state in the docs
so adding these work arounds allows them to be removed from the docs.

This also updates net, http_client and http_server to use the new
methods instead of manipulating readable and writable state directly.

See: #445
PR-URL: #12855
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>

MylesBorins added a commit that referenced this pull request Jan 10, 2018

2019-01-10 Version 9.4.0 (Current)
Notable change:

* async_hooks:
  - deprecate AsyncHooks Sensitive API and runInAsyncIdScope. Neither
    API were documented. (Andreas Madsen)
    #16972
* deps:
  - update nghttp2 to 1.29.0 (James M Snell)
    #17908
  - upgrade npm to 5.6.0 (Kat Marchán)
    #17535
  - cherry-pick 50f7455 from upstream V8 (Michaël Zasso)
    #16591
* events:
  - remove reaches into _events internals (Anatoli Papirovski)
    #17440
* http:
  - add rawPacket in err of `clientError` event (XadillaX)
    #17672
* http2:
  - implement maxSessionMemory (James M Snell)
    #17967
  - add initial support for originSet (James M Snell)
    #17935
  - add altsvc support (James M Snell)
    #17917
  - perf_hooks integration (James M Snell)
    #17906
* net:
  - remove Socket.prototype.write (Anna Henningsen)
    #17644
  - remove Socket.prototype.listen (Ruben Bridgewater)
    #13735
* repl:
  - show lexically scoped vars in tab completion (Michaël Zasso)
    #16591
* stream:
  - rm {writeable/readable}State.length (Calvin Metcalf)
    #12857
  - add flow and buffer properties to streams (Calvin Metcalf)
    #12855
* util:
  - allow wildcards in NODE_DEBUG variable (Tyler)
    #17609
* zlib:
  - add ArrayBuffer support (Jem Bezooyen)
    #16042
* Addedew collaborator**
  - [starkwang](https://github.com/starkwang) Weijia Wang
* Addedew TSC member**
  - [danbev](https://github.com/danbev) Daniel Bevenius

PR-URL: Coming Soon

@MylesBorins MylesBorins referenced this pull request Jan 10, 2018

Merged

v9.4.0 proposal #18069

MylesBorins added a commit that referenced this pull request Jan 10, 2018

2019-01-10 Version 9.4.0 (Current)
Notable change:

* async_hooks:
  - deprecate AsyncHooks Sensitive API and runInAsyncIdScope. Neither
    API were documented. (Andreas Madsen)
    #16972
* deps:
  - update nghttp2 to 1.29.0 (James M Snell)
    #17908
  - upgrade npm to 5.6.0 (Kat Marchán)
    #17535
  - cherry-pick 50f7455 from upstream V8 (Michaël Zasso)
    #16591
* events:
  - remove reaches into _events internals (Anatoli Papirovski)
    #17440
* http:
  - add rawPacket in err of `clientError` event (XadillaX)
    #17672
* http2:
  - implement maxSessionMemory (James M Snell)
    #17967
  - add initial support for originSet (James M Snell)
    #17935
  - add altsvc support (James M Snell)
    #17917
  - perf_hooks integration (James M Snell)
    #17906
* net:
  - remove Socket.prototype.write (Anna Henningsen)
    #17644
  - remove Socket.prototype.listen (Ruben Bridgewater)
    #13735
* repl:
  - show lexically scoped vars in tab completion (Michaël Zasso)
    #16591
* stream:
  - rm {writeable/readable}State.length (Calvin Metcalf)
    #12857
  - add flow and buffer properties to streams (Calvin Metcalf)
    #12855
* util:
  - allow wildcards in NODE_DEBUG variable (Tyler)
    #17609
* zlib:
  - add ArrayBuffer support (Jem Bezooyen)
    #16042
* Addedew collaborator**
  - [starkwang](https://github.com/starkwang) Weijia Wang
* Addedew TSC member**
  - [danbev](https://github.com/danbev) Daniel Bevenius

PR-URL: #18069

MylesBorins added a commit that referenced this pull request Jan 10, 2018

2019-01-10 Version 9.4.0 (Current)
Notable change:

* async_hooks:
  - deprecate AsyncHooks Sensitive API and runInAsyncIdScope. Neither
    API were documented. (Andreas Madsen)
    #16972
* deps:
  - update nghttp2 to 1.29.0 (James M Snell)
    #17908
  - upgrade npm to 5.6.0 (Kat Marchán)
    #17535
  - cherry-pick 50f7455 from upstream V8 (Michaël Zasso)
    #16591
* events:
  - remove reaches into _events internals (Anatoli Papirovski)
    #17440
* http:
  - add rawPacket in err of `clientError` event (XadillaX)
    #17672
* http2:
  - implement maxSessionMemory (James M Snell)
    #17967
  - add initial support for originSet (James M Snell)
    #17935
  - add altsvc support (James M Snell)
    #17917
  - perf_hooks integration (James M Snell)
    #17906
  - Refactoring and cleanup of Http2Session and Http2Stream destroy
    (James M Snell) #17406
* net:
  - remove Socket.prototype.write (Anna Henningsen)
    #17644
  - remove Socket.prototype.listen (Ruben Bridgewater)
    #13735
* repl:
  - show lexically scoped vars in tab completion (Michaël Zasso)
    #16591
* stream:
  - rm {writeable/readable}State.length (Calvin Metcalf)
    #12857
  - add flow and buffer properties to streams (Calvin Metcalf)
    #12855
* util:
  - allow wildcards in NODE_DEBUG variable (Tyler)
    #17609
* zlib:
  - add ArrayBuffer support (Jem Bezooyen)
    #16042
* Addedew collaborator**
  - [starkwang](https://github.com/starkwang) Weijia Wang
* Addedew TSC member**
  - [danbev](https://github.com/danbev) Daniel Bevenius

PR-URL: #18069

MylesBorins added a commit that referenced this pull request Jan 10, 2018

2019-01-10 Version 9.4.0 (Current)
Notable change:

* async_hooks:
  - deprecate AsyncHooks Sensitive API and runInAsyncIdScope. Neither
    API were documented. (Andreas Madsen)
    #16972
* deps:
  - update nghttp2 to 1.29.0 (James M Snell)
    #17908
  - upgrade npm to 5.6.0 (Kat Marchán)
    #17535
  - cherry-pick 50f7455 from upstream V8 (Michaël Zasso)
    #16591
* events:
  - remove reaches into _events internals (Anatoli Papirovski)
    #17440
* http:
  - add rawPacket in err of `clientError` event (XadillaX)
    #17672
* http2:
  - implement maxSessionMemory (James M Snell)
    #17967
  - add initial support for originSet (James M Snell)
    #17935
  - add altsvc support (James M Snell)
    #17917
  - perf_hooks integration (James M Snell)
    #17906
  - Refactoring and cleanup of Http2Session and Http2Stream destroy
    (James M Snell) #17406
* net:
  - remove Socket.prototype.write (Anna Henningsen)
    #17644
  - remove Socket.prototype.listen (Ruben Bridgewater)
    #13735
* repl:
  - show lexically scoped vars in tab completion (Michaël Zasso)
    #16591
* stream:
  - rm {writeable/readable}State.length (Calvin Metcalf)
    #12857
  - add flow and buffer properties to streams (Calvin Metcalf)
    #12855
* util:
  - allow wildcards in NODE_DEBUG variable (Tyler)
    #17609
* zlib:
  - add ArrayBuffer support (Jem Bezooyen)
    #16042
* Addedew collaborator**
  - [starkwang](https://github.com/starkwang) Weijia Wang
* Addedew TSC member**
  - [danbev](https://github.com/danbev) Daniel Bevenius

PR-URL: #18069

MylesBorins added a commit that referenced this pull request Jan 10, 2018

2019-01-10 Version 9.4.0 (Current)
Notable change:

* async_hooks:
  - deprecate AsyncHooks Sensitive API and runInAsyncIdScope. Neither
    API were documented. (Andreas Madsen)
    #16972
* deps:
  - update nghttp2 to 1.29.0 (James M Snell)
    #17908
  - upgrade npm to 5.6.0 (Kat Marchán)
    #17535
* events:
  - remove reaches into _events internals (Anatoli Papirovski)
    #17440
* http:
  - add rawPacket in err of `clientError` event (XadillaX)
    #17672
* http2:
  - implement maxSessionMemory (James M Snell)
    #17967
  - add initial support for originSet (James M Snell)
    #17935
  - add altsvc support (James M Snell)
    #17917
  - perf_hooks integration (James M Snell)
    #17906
  - Refactoring and cleanup of Http2Session and Http2Stream destroy
    (James M Snell) #17406
* net:
  - remove Socket.prototype.write (Anna Henningsen)
    #17644
  - remove Socket.prototype.listen (Ruben Bridgewater)
    #13735
* stream:
  - rm {writeable/readable}State.length (Calvin Metcalf)
    #12857
  - add flow and buffer properties to streams (Calvin Metcalf)
    #12855
* util:
  - allow wildcards in NODE_DEBUG variable (Tyler)
    #17609
* zlib:
  - add ArrayBuffer support (Jem Bezooyen)
    #16042
* Addedew collaborator**
  - [starkwang](https://github.com/starkwang) Weijia Wang
* Addedew TSC member**
  - [danbev](https://github.com/danbev) Daniel Bevenius

PR-URL: #18069

MylesBorins added a commit that referenced this pull request Jan 10, 2018

2019-01-10 Version 9.4.0 (Current)
Notable change:

* async_hooks:
  - deprecate AsyncHooks Sensitive API and runInAsyncIdScope. Neither
    API were documented. (Andreas Madsen)
    #16972
* deps:
  - update nghttp2 to 1.29.0 (James M Snell)
    #17908
  - upgrade npm to 5.6.0 (Kat Marchán)
    #17535
* events:
  - remove reaches into _events internals (Anatoli Papirovski)
    #17440
* http:
  - add rawPacket in err of `clientError` event (XadillaX)
    #17672
* http2:
  - implement maxSessionMemory (James M Snell)
    #17967
  - add initial support for originSet (James M Snell)
    #17935
  - add altsvc support (James M Snell)
    #17917
  - perf_hooks integration (James M Snell)
    #17906
  - Refactoring and cleanup of Http2Session and Http2Stream destroy
    (James M Snell) #17406
* net:
  - remove Socket.prototype.write (Anna Henningsen)
    #17644
  - remove Socket.prototype.listen (Ruben Bridgewater)
    #13735
* stream:
  - rm {writeable/readable}State.length (Calvin Metcalf)
    #12857
  - add flow and buffer properties to streams (Calvin Metcalf)
    #12855
* util:
  - allow wildcards in NODE_DEBUG variable (Tyler)
    #17609
* zlib:
  - add ArrayBuffer support (Jem Bezooyen)
    #16042
* Addedew collaborator**
  - [starkwang](https://github.com/starkwang) Weijia Wang
* Addedew TSC member**
  - [danbev](https://github.com/danbev) Daniel Bevenius

PR-URL: #18069

MylesBorins added a commit that referenced this pull request Jan 10, 2018

2019-01-10 Version 9.4.0 (Current)
Notable change:

* async_hooks:
  - deprecate AsyncHooks Sensitive API and runInAsyncIdScope. Neither
    API were documented. (Andreas Madsen)
    #16972
* deps:
  - update nghttp2 to 1.29.0 (James M Snell)
    #17908
  - upgrade npm to 5.6.0 (Kat Marchán)
    #17535
  - cherry-pick 50f7455 from upstream V8 (Michaël Zasso)
    #16591
* events:
  - remove reaches into _events internals (Anatoli Papirovski)
    #17440
* http:
  - add rawPacket in err of `clientError` event (XadillaX)
    #17672
* http2:
  - implement maxSessionMemory (James M Snell)
    #17967
  - add initial support for originSet (James M Snell)
    #17935
  - add altsvc support (James M Snell)
    #17917
  - perf_hooks integration (James M Snell)
    #17906
  - Refactoring and cleanup of Http2Session and Http2Stream destroy
    (James M Snell) #17406
* net:
  - remove Socket.prototype.write (Anna Henningsen)
    #17644
  - remove Socket.prototype.listen (Ruben Bridgewater)
    #13735
* repl:
  - show lexically scoped vars in tab completion (Michaël Zasso)
    #16591
* stream:
  - rm {writeable/readable}State.length (Calvin Metcalf)
    #12857
  - add flow and buffer properties to streams (Calvin Metcalf)
    #12855
* util:
  - allow wildcards in NODE_DEBUG variable (Tyler)
    #17609
* zlib:
  - add ArrayBuffer support (Jem Bezooyen)
    #16042
* Addedew collaborator**
  - [starkwang](https://github.com/starkwang) Weijia Wang
* Addedew TSC member**
  - [danbev](https://github.com/danbev) Daniel Bevenius

PR-URL: #18069

MylesBorins added a commit that referenced this pull request Jan 10, 2018

2019-01-10 Version 9.4.0 (Current)
Notable change:

* async_hooks:
  - deprecate AsyncHooks Sensitive API and runInAsyncIdScope. Neither
    API were documented. (Andreas Madsen)
    #16972
* deps:
  - update nghttp2 to 1.29.0 (James M Snell)
    #17908
  - upgrade npm to 5.6.0 (Kat Marchán)
    #17535
  - cherry-pick 50f7455 from upstream V8 (Michaël Zasso)
    #16591
* events:
  - remove reaches into _events internals (Anatoli Papirovski)
    #17440
* http:
  - add rawPacket in err of `clientError` event (XadillaX)
    #17672
* http2:
  - implement maxSessionMemory (James M Snell)
    #17967
  - add initial support for originSet (James M Snell)
    #17935
  - add altsvc support (James M Snell)
    #17917
  - perf_hooks integration (James M Snell)
    #17906
  - Refactoring and cleanup of Http2Session and Http2Stream destroy
    (James M Snell) #17406
* net:
  - remove Socket.prototype.write (Anna Henningsen)
    #17644
  - remove Socket.prototype.listen (Ruben Bridgewater)
    #13735
* repl:
  - show lexically scoped vars in tab completion (Michaël Zasso)
    #16591
* stream:
  - rm {writeable/readable}State.length (Calvin Metcalf)
    #12857
  - add flow and buffer properties to streams (Calvin Metcalf)
    #12855
* util:
  - allow wildcards in NODE_DEBUG variable (Tyler)
    #17609
* zlib:
  - add ArrayBuffer support (Jem Bezooyen)
    #16042
* Addedew collaborator**
  - [starkwang](https://github.com/starkwang) Weijia Wang
* Addedew TSC member**
  - [danbev](https://github.com/danbev) Daniel Bevenius

PR-URL: #18069

msoechting added a commit to hpicgs/node that referenced this pull request Feb 5, 2018

stream: add flow and buffer properties to streams
This adds computed properties to readable and writable streams to
allow access to the readable buffer, the writable buffer, and flow
state without accessing the readable or writable state.

These are the only uses of readable and writable state in the docs
so adding these work arounds allows them to be removed from the docs.

This also updates net, http_client and http_server to use the new
methods instead of manipulating readable and writable state directly.

See: nodejs#445
PR-URL: nodejs#12855
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>

msoechting added a commit to hpicgs/node that referenced this pull request Feb 5, 2018

2019-01-10 Version 9.4.0 (Current)
Notable change:

* async_hooks:
  - deprecate AsyncHooks Sensitive API and runInAsyncIdScope. Neither
    API were documented. (Andreas Madsen)
    nodejs#16972
* deps:
  - update nghttp2 to 1.29.0 (James M Snell)
    nodejs#17908
  - upgrade npm to 5.6.0 (Kat Marchán)
    nodejs#17535
  - cherry-pick 50f7455 from upstream V8 (Michaël Zasso)
    nodejs#16591
* events:
  - remove reaches into _events internals (Anatoli Papirovski)
    nodejs#17440
* http:
  - add rawPacket in err of `clientError` event (XadillaX)
    nodejs#17672
* http2:
  - implement maxSessionMemory (James M Snell)
    nodejs#17967
  - add initial support for originSet (James M Snell)
    nodejs#17935
  - add altsvc support (James M Snell)
    nodejs#17917
  - perf_hooks integration (James M Snell)
    nodejs#17906
  - Refactoring and cleanup of Http2Session and Http2Stream destroy
    (James M Snell) nodejs#17406
* net:
  - remove Socket.prototype.write (Anna Henningsen)
    nodejs#17644
  - remove Socket.prototype.listen (Ruben Bridgewater)
    nodejs#13735
* repl:
  - show lexically scoped vars in tab completion (Michaël Zasso)
    nodejs#16591
* stream:
  - rm {writeable/readable}State.length (Calvin Metcalf)
    nodejs#12857
  - add flow and buffer properties to streams (Calvin Metcalf)
    nodejs#12855
* util:
  - allow wildcards in NODE_DEBUG variable (Tyler)
    nodejs#17609
* zlib:
  - add ArrayBuffer support (Jem Bezooyen)
    nodejs#16042
* Addedew collaborator**
  - [starkwang](https://github.com/starkwang) Weijia Wang
* Addedew TSC member**
  - [danbev](https://github.com/danbev) Daniel Bevenius

PR-URL: nodejs#18069

msoechting added a commit to hpicgs/node that referenced this pull request Feb 7, 2018

stream: add flow and buffer properties to streams
This adds computed properties to readable and writable streams to
allow access to the readable buffer, the writable buffer, and flow
state without accessing the readable or writable state.

These are the only uses of readable and writable state in the docs
so adding these work arounds allows them to be removed from the docs.

This also updates net, http_client and http_server to use the new
methods instead of manipulating readable and writable state directly.

See: nodejs#445
PR-URL: nodejs#12855
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>

msoechting added a commit to hpicgs/node that referenced this pull request Feb 7, 2018

2019-01-10 Version 9.4.0 (Current)
Notable change:

* async_hooks:
  - deprecate AsyncHooks Sensitive API and runInAsyncIdScope. Neither
    API were documented. (Andreas Madsen)
    nodejs#16972
* deps:
  - update nghttp2 to 1.29.0 (James M Snell)
    nodejs#17908
  - upgrade npm to 5.6.0 (Kat Marchán)
    nodejs#17535
  - cherry-pick 50f7455 from upstream V8 (Michaël Zasso)
    nodejs#16591
* events:
  - remove reaches into _events internals (Anatoli Papirovski)
    nodejs#17440
* http:
  - add rawPacket in err of `clientError` event (XadillaX)
    nodejs#17672
* http2:
  - implement maxSessionMemory (James M Snell)
    nodejs#17967
  - add initial support for originSet (James M Snell)
    nodejs#17935
  - add altsvc support (James M Snell)
    nodejs#17917
  - perf_hooks integration (James M Snell)
    nodejs#17906
  - Refactoring and cleanup of Http2Session and Http2Stream destroy
    (James M Snell) nodejs#17406
* net:
  - remove Socket.prototype.write (Anna Henningsen)
    nodejs#17644
  - remove Socket.prototype.listen (Ruben Bridgewater)
    nodejs#13735
* repl:
  - show lexically scoped vars in tab completion (Michaël Zasso)
    nodejs#16591
* stream:
  - rm {writeable/readable}State.length (Calvin Metcalf)
    nodejs#12857
  - add flow and buffer properties to streams (Calvin Metcalf)
    nodejs#12855
* util:
  - allow wildcards in NODE_DEBUG variable (Tyler)
    nodejs#17609
* zlib:
  - add ArrayBuffer support (Jem Bezooyen)
    nodejs#16042
* Addedew collaborator**
  - [starkwang](https://github.com/starkwang) Weijia Wang
* Addedew TSC member**
  - [danbev](https://github.com/danbev) Daniel Bevenius

PR-URL: nodejs#18069
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment