(self)
Main processing loop, run until program exit
Main processing loop, run until program exit
Main processing loop run until program exit
async def process_q(self):
        '''
        Main processing loop, run until program exit
        '''
        while True:
            try:
                if self.q.qsize() > 0:
                    self.log.warning('Pending event queue size is: {}'.format(self.q.qsize()))
                msg = await self.q.get()
                
                if not self.command_q.empty():
                    self.log.info('Command waiting in queue')
                    await asyncio.sleep(1)
                    
                log_string, json_data = self.decode_payload(msg.topic,msg.payload)
                self.dict_merge(self.master_state, json_data)

                if self.pretty_print:
                    self.log.info("%-{:d}s : %s".format(self.master_indent) % (msg.topic, log_string))
                else:
                    self.log.info("Received Roomba Data: {}, {}".format(str(msg.topic), str(msg.payload)))

                if self.raw:
                    self.publish(msg.topic, msg.payload)
                else:
                    await self.loop.run_in_executor(None, self.decode_topics, json_data)
                    
                self.q.task_done()
                
            except asyncio.CancelledError:
                break
            except Exception as e:
                self.log.exception(e)
async def process_q ( self ) : while True : try : if self . q . qsize ( ) > 0 : self . log . warning ( 'Pending event queue size is: {}' . format ( self . q . qsize ( ) ) ) msg = await self . q . get ( ) if not self . command_q . empty ( ) : self . log . info ( 'Command waiting in queue' ) await asyncio . sleep ( 1 ) log_string , json_data = self . decode_payload ( msg . topic , msg . payload ) self . dict_merge ( self . master_state , json_data ) if self . pretty_print : self . log . info ( "%-{:d}s : %s" . format ( self . master_indent ) % ( msg . topic , log_string ) ) else : self . log . info ( "Received Roomba Data: {}, {}" . format ( str ( msg . topic ) , str ( msg . payload ) ) ) if self . raw : self . publish ( msg . topic , msg . payload ) else : await self . loop . run_in_executor ( None , self . decode_topics , json_data ) self . q . task_done ( ) except asyncio . CancelledError : break except Exception as e : self . log . exception ( e )