stripe / subprocess

A port of Python's subprocess module to Ruby
MIT License
209 stars 17 forks source link

Yield status to `communicate` block on exit #41

Closed andrew-stripe closed 6 years ago

andrew-stripe commented 6 years ago

Currently we only exit the communicate loop when we get an EOF from stdout and stderr. If the child process forks before exiting, the fork will inherit those file descriptors and communicate will hang until the child exits. By yielding the status to a block passed to communicate after reading from self_read, we allow the caller to break out of communicate instead of hanging. This is an alternative to #39.

r? @nelhage-stripe

nelhage-stripe commented 6 years ago

I think I prefer this approach, but I'm not sure

nelhage-stripe commented 6 years ago

Superceded by #39