streams
streams copied to clipboard
const [ sideA, sideB ] = duplexPair();
What is the issue with the Streams Standard?
const [ sideA, sideB ] = duplexPair();
Could you elaborate? I cannot identify any action I can take based on the information you have provided.
If I had to guess I'd say the ask for a convenience API the essentially implements:
function duplexPair() {
const {
readable : r1,
writable: w1,
} = new TransformStream();
const {
readable: r2,
writable: w2,
} = new TransformStream();
return [
{ readable: r1, writable: w2 },
{ readable: r2, writable: w1 },
];
}
But with some additional lifecycle handling that ensures half-open is optionally handled and error state is propagated across the two halves?
Similar to Node.js' equivalent API: https://nodejs.org/docs/latest/api/stream.html#streamduplexpairoptions