#NEWLINE# def __init__( self , zmq_host , zmq_work_port , zmq_results_port , worker_id , max_retries , profile_count = 0 , concurrency = 256 , batch_size = 1 ) : #NEWLINE# #INDENT# work_endpoint = ( 'tcp://%s:%d' % ( zmq_host , zmq_work_port ) ) #NEWLINE# results_endpoint = ( 'tcp://%s:%d' % ( zmq_host , zmq_results_port ) ) #NEWLINE# ipv6 = is_ipv6 ( zmq_host ) #NEWLINE# self . worker_id = worker_id #NEWLINE# self . max_retries = max_retries #NEWLINE# self . profile_count = profile_count #NEWLINE# self . batch_size = batch_size #NEWLINE# raise_file_descriptor_limit ( ) #NEWLINE# self . concurrency = concurrency #NEWLINE# self . conn_pools_lock = gevent . coros . Semaphore ( 1 ) #NEWLINE# self . conn_pools = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . token_data = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . token_data_lock = gevent . coros . Semaphore ( 1 ) #NEWLINE# self . context = zmq . Context ( ) #NEWLINE# self . work_pull = self . context . socket ( zmq . PULL ) #NEWLINE# self . work_pull . ipv6 = ipv6 #NEWLINE# self . work_pull . connect ( work_endpoint ) #NEWLINE# self . results_push = self . context . socket ( zmq . PUSH ) #NEWLINE# self . results_push . ipv6 = ipv6 #NEWLINE# self . results_push . connect ( results_endpoint ) #NEWLINE# self . result_queue = gevent . queue . Queue ( )