Closed romanlevin closed 7 years ago
Pinging @lordmauve
Hi, sorry for the delay.
I think it might be a better idea for close()
to simply signal the process in the default case, rather than waiting.
I wouldn't be averse to having the stronger version - wait for process to die, or kill it - with something like close(force=True).
@lordmauve I replaced timeout
with a polling loop. Do you still think it should just not wait by default?
@lordmauve I've tested with both Python 2.7.13 (wheren Popen.stdin
is a file descriptor) and with Python 3.6.1 (where it is an io.BufferedWriter
), and both allow multiple calls to close()
.
Any subsequent calls are noops.
Ok, then!
This is kind of rough at the moment (at very least, the timeout needs to be configurable), but I was wondering if you'd be interested in a cleaned up version of this.