http2: support generic `Duplex` streams
Commits:
-
src: allow top-level calls into JSStream Allow
JSStream
instances to be used more flexibly by explicitly enabling calls that have no JS stack below them. -
src: turn JS stream into a full duplex Remove unused methods for reading data from
JSStream
and add those required for emitting data or an EOF event to the JS side, in essentially the same way thatLibuvStreamWrap
does it. -
http2: support generic
Duplex
streams Support genericDuplex
streams through usingStreamWrap
on the server and client sides, and adding acreateConnection
method option similar to what the HTTP/1 API provides.Since HTTP2 is, as a protocol, independent of its underlying transport layer, Node.js should not enforce any restrictions on what streams its internals may use.
Ref: #16256 (closed)
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines
Affected core subsystem(s)
http2