def run(self):
        """When the consumer is ready to start running, kick off all of our
        consumer consumers and then loop while we process messages.

        """
        self.set_state(self.STATE_ACTIVE)
        self.setup_consumers()

        # Set the SIGCHLD handler for child creation errors
        signal.signal(signal.SIGCHLD, self.on_sigchld)

        # Set the SIGALRM handler for poll interval
        signal.signal(signal.SIGALRM, self.on_timer)

        # Kick off the poll timer
        signal.setitimer(signal.ITIMER_REAL, self.poll_interval, 0)

        # Loop for the lifetime of the app, pausing for a signal to pop up
        while self.is_running:
            if not self.is_sleeping:
                self.set_state(self.STATE_SLEEPING)
            signal.pause()

        # Note we're exiting run
        LOGGER.info('Exiting Master Control Program')
def run ( self ) : self . set_state ( self . STATE_ACTIVE ) self . setup_consumers ( ) signal . signal ( signal . SIGCHLD , self . on_sigchld ) signal . signal ( signal . SIGALRM , self . on_timer ) signal . setitimer ( signal . ITIMER_REAL , self . poll_interval , 0 ) while self . is_running : if not self . is_sleeping : self . set_state ( self . STATE_SLEEPING ) signal . pause ( ) LOGGER . info ( 'Exiting Master Control Program' )
When the consumer is ready to start running, kick off all of our
        consumer consumers and then loop while we process messages.