Example #1
0
 def call_with_address(self, service, request, address):
     with self.lock:
         socket = self.bus.ctx.socket(zmq.REQ)
         socket.connect(address)
         socket.send(call.encode_req(service, request))
         s = socket.recv()
         return call.decode_res(s)
Example #2
0
 def call_with_address(self, service, request, address):
     with self.lock:
         socket = self.bus.ctx.socket(zmq.REQ)
         socket.connect(address)
         socket.send(call.encode_req(service, request))
         s = socket.recv()
         return call.decode_res(s)
Example #3
0
 def test_encode_req(self):
     self.assertEqual(msgpack.packb(['hello', 123]),
                      call.encode_req('hello', 123))
Example #4
0
 def test_decode_req(self):
     self.assertEqual(['hello', 123],
                      call.decode_req(call.encode_req('hello', 123)))
Example #5
0
 def test_encode_req(self):
     self.assertEqual(msgpack.packb(['hello', 123]),
                      call.encode_req('hello', 123))
Example #6
0
 def test_decode_req(self):
     self.assertEqual(['hello', 123],
                      call.decode_req(call.encode_req('hello', 123)))