-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Standardize ready
event for built-in streams
#19304
Comments
I've seen |
@addaleax would this just involve renaming the event being emitted to |
@mscdex Do you have any suggestions? Should we just try it, see if something breaks, and otherwise rename? @ryzokuken It would mean adding the event in the places where the other events are currently being emitted. I think renaming them, including removing the old names, would be too much of a breaking change. |
Agreed. Emitting an extra event sounds like a much safer approach.
…On Tue 13 Mar, 2018, 2:32 AM Anna Henningsen, ***@***.***> wrote:
@mscdex <https://github.com/mscdex> Do you have any suggestions? Should
we just try it, see if something breaks, and otherwise rename?
@ryzokuken <https://github.com/ryzokuken> It would mean adding the event
in the places where the other events are currently being emitted. I think
renaming them, including removing the old names, would be too much of a
breaking change.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#19304 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AMg3MvTa5br9BW0JHxLjDBz8h_GHaTQzks5tduJigaJpZM4SnOfl>
.
|
It’s going to be helpful in merging streams code between the different implementations. |
Actually, it would also be nice to have something like the corresponding boolean property, which is |
I think the term For example, if you make a TLS connection, what does "ready" mean? That the underlying TCP connection was established or that the TLS handshake completed successfully? Do we then have to still have distinguishing events, like I just don't see the value in potentially adding more confusion by using a subjective term in core (I haven't paid attention to http/2 support, but I am surprised it is currently using such an event name). |
We can bikeshed over the name.
The latter.
No.
No.
You are conflating two things here: The naming of the event (which can be subjective, granted) and whether we should have a single, consistent event name used for these streams. As mentioned above, I’m okay with another name; the semantics are “this is the point from where reading and writing data actually works”. I think I do see value in having a single, consistent event name: Partly because it makes our APIs more consistent, which seems like an inherently good thing to me, but mostly because it would actually simplify re-using code between these implementations. (I opened this issue specifically because of that.) |
I would like to take this one 😄 |
@j0t3x I assume you have read the discussion here – if you want to open a PR, feel free to go for it. :) Let us know if you have any questions! |
I will take some time this night to work on it |
… to the event names they currently use. Currently, various internal streams have different events that indicate that the underlying resource has successfully been established. This commit adds ready event for fs and net sockets to standardize on emitting ready for all of these streams. Fixes: nodejs#19304
@addaleax Anna, |
removed file descriptor for ready event in fs streams and updated test case to check only for ready event. Fixes: nodejs#19304
removed file descriptor for ready event in fs streams and updated test case to check only for ready event. Fixes: nodejs#19304
updated test case updated test case to check for ready event on writestream Fixes: nodejs#19304
... in addition to the event names they currently use. Currently, various internal streams have different events that indicate that the underlying resource has successfully been established. This commit adds ready event for fs and net sockets to standardize on emitting ready for all of these streams. PR-URL: #19408 Fixes: #19304 Reviewed-By: Anna Henningsen <anna@addaleax.net>
... in addition to the event names they currently use. Currently, various internal streams have different events that indicate that the underlying resource has successfully been established. This commit adds ready event for fs and net sockets to standardize on emitting ready for all of these streams. PR-URL: #19408 Fixes: #19304 Reviewed-By: Anna Henningsen <anna@addaleax.net>
... in addition to the event names they currently use. Currently, various internal streams have different events that indicate that the underlying resource has successfully been established. This commit adds ready event for fs and net sockets to standardize on emitting ready for all of these streams. PR-URL: #19408 Fixes: #19304 Reviewed-By: Anna Henningsen <anna@addaleax.net>
... in addition to the event names they currently use. Currently, various internal streams have different events that indicate that the underlying resource has successfully been established. This commit adds ready event for fs and net sockets to standardize on emitting ready for all of these streams. PR-URL: #19408 Fixes: #19304 Reviewed-By: Anna Henningsen <anna@addaleax.net>
... in addition to the event names they currently use. Currently, various internal streams have different events that indicate that the underlying resource has successfully been established. This commit adds ready event for fs and net sockets to standardize on emitting ready for all of these streams. PR-URL: #19408 Fixes: #19304 Reviewed-By: Anna Henningsen <anna@addaleax.net>
... in addition to the event names they currently use. Currently, various internal streams have different events that indicate that the underlying resource has successfully been established. This commit adds ready event for fs and net sockets to standardize on emitting ready for all of these streams. PR-URL: #19408 Fixes: #19304 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Currently, various internal streams have different events that indicate that the underlying resource has successfully been established:
fs
streams use theopen
event once the file descriptor is availablenet.Socket
s use theconnect
event once the socket has been establishedHttp2Stream
s use theready
event once the underlying http/2 session is establishedI would like to suggest standardizing on emitting
ready
for all of these streams, i.e. emittingready
forfs
streams and network sockets in addition to the event names they currently use.If there are no objections, I think this makes for a good first contribution.
The text was updated successfully, but these errors were encountered: