Use pump with a Transform Stream as final stream object
See original GitHub issueUsing pump
like this;
pump.apply null, [
tcpSocket
transformStream
writableStream
handleEndFn
]
will call the handleEndFn
just fine when the TCP socket breaks / closes.
Now, due to the way the destroyer passes its arguments (based on the stream object position) to the end-of-stream
module, the following
pump.apply null, [
tcpSocket
transformStream
transformStream
handleEndFn
]
will not trigger the handleEndFn
function (allowHalfOpen
defaults to true
).
What would be the handest way to circumfence the obliged applcation of pump
, but now using a Transform Stream as the last stream object in the pipeline?
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Using readable streams - Web APIs | MDN
As our Simple stream pump example shows (see it live also), exposing it is a matter of just accessing the body property of...
Read more >Backpressuring in Streams
This is a module method to pipe between streams forwarding errors and properly cleaning up and provide a callback when the pipeline is...
Read more >Using Streams · Cloudflare Workers docs
You can use TransformStream to stream a response body after sending ... This example just pumps the subrequest response body to the final...
Read more >Long Object Stream with Asynchronous Transform Ending ...
I am piping the response from a Node request into a transform stream using through2Concurrent . This response comes in as a buffer...
Read more >Process streaming JSON with Node.js | by Jake Burden
It's also a good habit to use a module called pump to handle the streams. Pump handles closing streams if the destination closes...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah yes. Thanks a lot for explaining!
By calling the cb right away you never hit backpressure yes