Open sunshowers opened 3 years ago
I think try_wait
shold only block on handles if you've used stdout_capture
or similar. So what if instead you opened your own pipes with os_pipe
, supplied those via stdout_file
or similar, and then used try_wait
? Then you could inspect your end of the pipes however you like after you get a return value?
Currently,
duct
'sHandle
method appears to provide two methods:wait()
, which waits for process exit and for output handles (stdout/stderr) to be closed, andtry_wait()
, which checks if the process has exited and:Ok(None)
wait()
and blocks on handles being closed.I have a use case for a
wait()
which does not want to wait on handles being closed: specifically, I'm writing a test runner which wants to be able to detect leaked processes and fail a test if the process has exited without handles being closed.Would it make sense to support that in
duct
? I'm not exactly sure what a reasonable API for this is. Grandchild handling is so messy on Unix anyway.