#NEWLINE# def worker_input_generator( self ) : #NEWLINE# #INDENT# 'Call this on the worker processes: yields input.' #NEWLINE# while True : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# x = self . input_queue . get ( timeout = _IDLE_TIMEOUT ) #NEWLINE# if ( x is None ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if ( self . input_index is not None ) : #NEWLINE# #INDENT# vimap . exception_handling . print_warning ( "Didn't produce an output for input!" , input_index = self . input_index ) #NEWLINE# #UNINDENT# ( self . input_index , z ) = x #NEWLINE# self . debug ( 'Got input #{0}' , self . input_index ) #NEWLINE# ( yield z ) #NEWLINE# #UNINDENT# except multiprocessing . queues . Empty : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# except IOError : #NEWLINE# #INDENT# print ( 'Worker error getting item from input queue' , file = sys . stderr ) #NEWLINE# raise