-
Notifications
You must be signed in to change notification settings - Fork 231
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
cork()/uncork() and pipe() #145
Comments
something like https://github.com/calvinmetcalf/SBS ? |
Yeah, but with |
My use case is following (if you are interested). I have a protocol framer (say HTTP2), which is basically a readable stream. It emits frames in chunks (i.e. separate chunk for header, for body, sometimes more), and always does this synchronously (i.o.w. without delay between the chunks). The owner of the framer pipes it into the socket, and now all of these pushes in framer result in separate TCP packets (especially when using noDelay), but it could potentially be just a single |
could be an option we could add to pipe |
Oh, that sounds right! I forgot that |
Why not auto cork on the initial write and queue a nextTick to uncork? Could be an option on the pipe, but the handling of packets is automated. |
@trevnorris this is what I want :) |
Adds an option to .pipe to cork it before each write and then uncork it next tick, based on discussion at nodejs/readable-stream#145
Closing now, as the PR has been debated and closed. |
It would be great if
pipe()
could somehow docork()
/uncork()
to minimize amount of the TCP packets when piping to thenet.Socket
. Does anyone have an idea how to expose this to users? Or how to handle it?Should we just cork and uncork on next tick as we do in http?
The text was updated successfully, but these errors were encountered: