コード例 #1
0
ファイル: sender.py プロジェクト: blacktear23/py-servicebus
 def send(self, target, params):
     target, category, service = self.parse_target(target)
     caller = self.choose_caller(target)
     if caller is None:
         raise Exception("Cannot connect to %s" % target)
     req_msg = XmlRequestGenerator(self.configuration, category, service, params)
     caller.send(target, req_msg.to_xml())
コード例 #2
0
ファイル: sender.py プロジェクト: blacktear23/py-servicebus
 def send(self, target, params):
     target, category, service = self.parse_target(target)
     caller = self.choose_caller(target)
     if caller is None:
         raise Exception("Cannot connect to %s" % target)
     req_msg = XmlRequestGenerator(self.configuration, category, service,
                                   params)
     caller.send(target, req_msg.to_xml())
コード例 #3
0
ファイル: sender.py プロジェクト: blacktear23/py-servicebus
 def call(self, target, params, timeout=300, reverse=False):
     target, category, service = self.parse_target(target)
     caller = self.choose_caller(target, reverse)
     if caller is None:
         raise Exception("Cannot connect to %s" % target)
     req_msg = XmlRequestGenerator(self.configuration, category, service, params)
     ret = caller.call(target, req_msg.to_xml(), timeout)
     resp_parser = XmlResponseParser()
     return resp_parser.parse(ret)
コード例 #4
0
ファイル: sender.py プロジェクト: blacktear23/py-servicebus
 def call(self, target, params, timeout=300, reverse=False):
     target, category, service = self.parse_target(target)
     caller = self.choose_caller(target, reverse)
     if caller is None:
         raise Exception("Cannot connect to %s" % target)
     req_msg = XmlRequestGenerator(self.configuration, category, service,
                                   params)
     ret = caller.call(target, req_msg.to_xml(), timeout)
     resp_parser = XmlResponseParser()
     return resp_parser.parse(ret)
コード例 #5
0
ファイル: sender.py プロジェクト: linglan520/py-servicebus
    def call(self, target, params, timeout=300):
        target, category, service = self.parse_target(target)
        if target == self.configuration.node_name:
            raise Exception("Target is self, cannot do RPC %s.%s.%s" % (target, category, service))

        if not self.ping(target):
            raise Exception("Cannot connect to %s" % target)
        caller = self.get_caller()
        req_msg = XmlRequestGenerator(self.configuration, category, service, params)
        ret = caller.call(target, req_msg.to_xml(), timeout)
        resp_parser = XmlResponseParser()
        return resp_parser.parse(ret)
コード例 #6
0
ファイル: sender.py プロジェクト: linglan520/py-servicebus
 def send(self, target, params):
     target, category, service = self.parse_target(target)
     caller = self.get_caller()
     req_msg = XmlRequestGenerator(self.configuration, category, service, params)
     caller.send(target, req_msg.to_xml())