def _run(self): """Run method that can be profiled""" self._ioloop = ioloop.IOLoop.instance() common.add_null_handler() try: self.setup(self._kwargs['config'], self._kwargs['connection_name'], self._kwargs['consumer_name'], self._kwargs['stats_queue'], self._kwargs['logging_config']) except ImportError as error: name = self._kwargs['consumer_name'] classname = self._kwargs['config']['Consumers'][name]['consumer'] LOGGER.critical('Could not import %s, stopping process: %r', classname, error) return if not self.is_stopped: try: self._ioloop.start() except KeyboardInterrupt: LOGGER.warning('CTRL-C while waiting for clean shutdown')
def setup(self): """Continue the run process blocking on MasterControlProgram.run""" # If the app was invoked to specified to prepend the path, do so now common.add_null_handler() if self.args.prepend_path: self._prepend_python_path(self.args.prepend_path)