You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The IDuplex interface and friends all have a close function but the majority of the out of the box implementations of these interfaces have questionable use / implementations.
Closing file descriptors 0-2 (stdio) is bad for security reasons and libuv has inconcistent behaviour on different systems with this. Due to this my implementation always returns success when closing the current process stdio and doesn't call uv_close. The bigger question is why would the user actually want to close the stdout of the current process?
Closing the pipes of a spawned process does work, but would the user really want to do it? Assuming calling close on the ChildProcess object will automatically clean up those pipes what use cases are there for closing child process pipes early?
The only place close has a real purpose is sockets and servers where they close connections and stop the server respectively.
File operations make no use of IDuplex or related interfaces.
Considering 2 / 3 of the close implementations are questionable at best it seems like this design is wrong. Obviously there is a use for closable streams and user defined ones might have need of them, but it does seem like we need something to represent an non-closable streams as well.
The text was updated successfully, but these errors were encountered:
The
IDuplex
interface and friends all have aclose
function but the majority of the out of the box implementations of these interfaces have questionable use / implementations.uv_close
. The bigger question is why would the user actually want to close the stdout of the current process?close
on theChildProcess
object will automatically clean up those pipes what use cases are there for closing child process pipes early?close
has a real purpose is sockets and servers where they close connections and stop the server respectively.IDuplex
or related interfaces.Considering 2 / 3 of the close implementations are questionable at best it seems like this design is wrong. Obviously there is a use for closable streams and user defined ones might have need of them, but it does seem like we need something to represent an non-closable streams as well.
The text was updated successfully, but these errors were encountered: