#NEWLINE# def process( self ) : #NEWLINE# #INDENT# while True : #NEWLINE# #INDENT# item = self . task_queue . get ( ) #NEWLINE# t0 = time . time ( ) #NEWLINE# worker_name = threading . current_thread ( ) . name #NEWLINE# try : #NEWLINE# #INDENT# item . process ( ) #NEWLINE# context . main_logger . debug ( '{worker} took: {took} seconds to process {item}' . format ( worker = worker_name , took = ( time . time ( ) - t0 ) , item = item . __class__ . __name__ ) ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# context . main_logger . exception ( 'RequestProcessor failed to process item: {}' . format ( item ) )