def runAppCallbacks(self, reason):
        if self._pid:
            import os #work around for randomly missing sigchild
            try: os.waitpid(self._pid, os.WNOHANG)
            except: pass
        if not self.deferredResult.called:
            #give the caller some context to work with
            self.logger("Process %d is no longer running" % self._pid)
            result = {
                'description': 'Application Exited',
                'code': reason.value.exitCode,
                'pid': self.PID,
                'stdout': self.STDOUT,
                'stderr': self.STDERR,
                'screen': self.OUTPUT,
                'error': False,
            }
            if result['code'] == 0:
                self.deferredResult.callback(result)
            else:
                result['description'] = reason.getErrorMessage()
                result['error'] = True
                result['stacktrace'] = reason.getTraceback()
                self.deferredResult.errback(DroneCommandFailed(result))

        return
Trigger our callbacks to run now, you should add your own callback hooks
dataset/ETHPy150Open OrbitzWorldwide/droned/droned/lib/droned/protocols/application.py/ApplicationProtocol.runAppCallbacks