oconnor663 / duct.rs

a Rust library for running child processes
MIT License
795 stars 34 forks source link

inconsistency between Handle and ReaderHandle #84

Open oconnor663 opened 4 years ago

oconnor663 commented 4 years ago

The latter kills on drop, the former doesn't. That seems like a pretty bad inconsistency. Maybe Handle should kill on drop too?

oconnor663 commented 4 years ago

Actually, it would probably be better for both to use a background thread to wait. Maybe we could avoid the implicit killing entirely.

oconnor663 commented 3 years ago

Would it make sense to take a similar approach to partially started pipelines? Killing processes is gross. We could spawn a background thread to wait for the left half to exit on its own, which should be prompt in the vast majority of cases because of SIGPIPE or similar. (Or do nothing on Windows as an optimization, since zombies aren't a concern there, but probably no one cares about the thread.)