zmqclient.py
branchstable
changeset 8572 e54b3bc39011
parent 8352 0e3b41118631
child 8670 f02139297beb
equal deleted inserted replaced
8571:7e5246889148 8572:e54b3bc39011
    41     Any raised exception on the remote source is propagated locally.
    41     Any raised exception on the remote source is propagated locally.
    42 
    42 
    43     ZMQ is used as the transport layer and cPickle is used to serialize data.
    43     ZMQ is used as the transport layer and cPickle is used to serialize data.
    44     """
    44     """
    45 
    45 
    46     def __init__(self, config, vreg=None):
    46     def __init__(self, zmq_address):
    47         self.config = config
       
    48         self.vreg = vreg
       
    49         self.socket = ctx.socket(zmq.REQ)
    47         self.socket = ctx.socket(zmq.REQ)
    50         self.host = config.get('base-url')
    48         self.socket.connect(zmq_address)
    51         self.socket.connect(self.host)
       
    52 
    49 
    53     def __zmqcall__(self, name, *args, **kwargs):
    50     def __zmqcall__(self, name, *args, **kwargs):
    54          self.socket.send_pyobj([name, args, kwargs])
    51          self.socket.send_pyobj([name, args, kwargs])
    55          result = self.socket.recv_pyobj()
    52          result = self.socket.recv_pyobj()
    56          if isinstance(result, BaseException):
    53          if isinstance(result, BaseException):