#NEWLINE# def run( self ) : #NEWLINE# #INDENT# self . heartbeat . send ( 'STARTED' ) #NEWLINE# while self . should_continue ( ) : #NEWLINE# #INDENT# ( messages , time ) = self . poller . poll ( 1000 ) #NEWLINE# if ( 'frontend' in self ) : #NEWLINE# #INDENT# self . handle_request ( messages [ 'frontend' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not self . is_online_recognition_running ( ) ) : #NEWLINE# #INDENT# self . heartbeat . send ( 'WAITING' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . end_recognition ( ) #NEWLINE# self . heartbeat . send ( 'FINISHED' )