stream: Expose DuplexPair API
The "Duplex Pair" pattern is a function that creates two symmetrical Duplex streams, such that what is written on one side will become readable on the other.
This pattern is used by the tls
module in core, and in a great number of the tests. This PR merges the two implementations together into a single stream.DuplexPair
implementation.
See #29986 (closed) for a discussion of this feature.
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