def run(self, asynchronous=False):
        '''
        Load and start all available api modules
        '''
        log.debug('Process Manager starting!')
        appendproctitle(self.name)

        # make sure to kill the subprocesses if the parent is killed
        if signal.getsignal(signal.SIGTERM) is signal.SIG_DFL:
            # There are no SIGTERM handlers installed, install ours
            signal.signal(signal.SIGTERM, self.kill_children)
        if signal.getsignal(signal.SIGINT) is signal.SIG_DFL:
            # There are no SIGINT handlers installed, install ours
            signal.signal(signal.SIGINT, self.kill_children)

        while True:
            log.trace('Process manager iteration')
            try:
                # in case someone died while we were waiting...
                self.check_children()
                # The event-based subprocesses management code was removed from here
                # because os.wait() conflicts with the subprocesses management logic
                # implemented in `multiprocessing` package. See #35480 for details.
                if asynchronous:
                    yield gen.sleep(10)
                else:
                    time.sleep(10)
                if not self._process_map:
                    break
            # OSError is raised if a signal handler is called (SIGTERM) during os.wait
            except OSError:
                break
            except IOError as exc:
                # IOError with errno of EINTR (4) may be raised
                # when using time.sleep() on Windows.
                if exc.errno != errno.EINTR:
                    raise
                break
def run ( self , asynchronous = False ) : log . debug ( 'Process Manager starting!' ) appendproctitle ( self . name ) if signal . getsignal ( signal . SIGTERM ) is signal . SIG_DFL : signal . signal ( signal . SIGTERM , self . kill_children ) if signal . getsignal ( signal . SIGINT ) is signal . SIG_DFL : signal . signal ( signal . SIGINT , self . kill_children ) while True : log . trace ( 'Process manager iteration' ) try : self . check_children ( ) if asynchronous : yield gen . sleep ( 10 ) else : time . sleep ( 10 ) if not self . _process_map : break except OSError : break except IOError as exc : if exc . errno != errno . EINTR : raise break
Load and start all available api modules