MCPcopy Create free account
hub / github.com/apache/qpid-proton / call

Method call

python/proton/_utils.py:604–624  ·  view source on GitHub ↗

Send a request message, wait for and return the response message. :param request: Request message. If ``self.address`` is not set the request message address must be set and will be used.

(self, request: 'Message')

Source from the content-addressed store, hash-verified

602 self.response = None
603
604 def call(self, request: 'Message') -> 'Message':
605 """
606 Send a request message, wait for and return the response message.
607
608 :param request: Request message. If ``self.address`` is not set the
609 request message address must be set and will be used.
610 """
611 if not self.address and not request.address:
612 raise ValueError("Request message has no address: %s" % request)
613 request.reply_to = self.reply_to
614 request.correlation_id = correlation_id = str(self.correlation_id.next())
615 self.sender.send(request)
616
617 def wakeup():
618 return self.response and (self.response.correlation_id == correlation_id)
619
620 self.connection.wait(wakeup, msg="Waiting for response")
621 response = self.response
622 self.response = None # Ready for next response.
623 self.receiver.flow(1) # Set up credit for the next response.
624 return response
625
626 @property
627 def reply_to(self) -> str:

Callers 7

testMethod · 0.45
_cyrusSetupFunction · 0.45
sync_client.pyFile · 0.45
processMethod · 0.45

Calls 5

waitMethod · 0.65
strFunction · 0.50
nextMethod · 0.45
sendMethod · 0.45
flowMethod · 0.45