def client_generator(port=5557, host='localhost', hwm=20):
 context = zmq.Context()
 socket = context.socket(zmq.PULL)
 socket.set_hwm(hwm)
 socket.connect('tcp://{}:{}'.format(host, port))
 logger.info('client started')
 while True:
  data = recv_arrays(socket)
  (yield tuple(data))

def client_generator ( port = 5557 , host = 'localhost' , hwm = 20 ) : context = zmq . Context ( ) socket = context . socket ( zmq . PULL ) socket . set_hwm ( hwm ) socket . connect ( 'tcp://{}:{}' . format ( host , port ) ) logger . info ( 'client started' ) while True : data = recv_arrays ( socket ) ( yield tuple ( data ) )
generator in client side should extend this generator parameters port : int hwm : int .