def doRead(self): """ Having woken up the reactor in response to receipt of C{SIGCHLD}, reap the process which exited. This is called whenever the reactor notices the waker pipe is writeable, which happens soon after any call to the C{wakeUp} method. """ _FDWaker.doRead(self) process.reapAllProcesses()
def _handleSignals(self): """ Extend the basic signal handling logic to also support handling SIGCHLD to know when to try to reap child processes. """ _SignalReactorMixin._handleSignals(self) if platformType == 'posix': if not self._childWaker: self._childWaker = _SIGCHLDWaker(self) self._internalReaders.add(self._childWaker) self.addReader(self._childWaker) self._childWaker.install() # Also reap all processes right now, in case we missed any # signals before we installed the SIGCHLD waker/handler. # This should only happen if someone used spawnProcess # before calling reactor.run (and the process also exited # already). process.reapAllProcesses()