equal
deleted
inserted
replaced
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): |