Lines Matching full:message

25 from .message import Message
74 :param sent: The sent RPC message that caused the failure.
78 sent: Message, received: Message): argument
80 #: The sent `Message` that caused the failure
81 self.sent: Message = sent
82 #: The received `Message` that indicated failure
83 self.received: Message = received
104 Abstract error class for protocol errors that have a `Message` object.
106 This Exception class is used for protocol errors where the `Message`
111 :param msg: The QMP `Message` that caused the error.
113 def __init__(self, error_message: str, msg: Message): argument
115 #: The received `Message` that caused the error.
116 self.msg: Message = msg
121 f" Message was: {str(self.msg)}\n",
127 The Server sent a `Message` indicating parsing failure.
133 :param msg: The QMP `Message` that caused the error.
141 If a QMP message is received with an 'id' field to allow it to be
144 A reply message is malformed if it is missing either the 'return' or
150 :param sent: The message that was sent that prompted the error.
152 def __init__(self, error_message: str, msg: Message, sent: Message): argument
154 #: The sent `Message` that caused the failure
158 class QMPClient(AsyncProtocol[Message], Events):
204 _PendingT = Union[Message, ExecInterruptedError]
342 async def _on_message(self, msg: Message) -> None: argument
344 Add an incoming message to the appropriate queue/handler.
346 :raise ServerParseError: When Message indicates server parse failure.
363 # We have a message we can't route back to a caller.
385 "Unknown ID '%s', message dropped.",
388 self.logger.debug("Unroutable message: %s", str(msg))
392 async def _do_recv(self) -> Message:
397 When the Message is not understood.
398 See also `Message._deserialize`.
400 :return: A single QMP `Message`.
403 msg = Message(msg_bytes, eager=True)
408 def _do_send(self, msg: Message) -> None: argument
424 async def _issue(self, msg: Message) -> Union[None, str]: argument
426 Issue a QMP `Message` and do not wait for a reply.
428 :param msg: The QMP `Message` to send to the server.
430 :return: The ID of the `Message` sent.
447 async def _reply(self, msg_id: Union[str, None]) -> Message:
449 Await a reply to a previously issued QMP message.
451 :param msg_id: The ID of the previously issued message.
469 async def _execute(self, msg: Message, assign_id: bool = True) -> Message: argument
471 Send a QMP `Message` to the server and await a reply.
481 :param msg: The QMP `Message` to execute.
502 msg: Union[Message, Mapping[str, object], bytes], argument
504 ) -> Message:
506 Issue a raw `Message` to the QMP server and await a reply.
509 A Message to send to the server. It may be a `Message`, any
512 Assign an arbitrary execution ID to this message. If
529 # 1. convert generic Mapping or bytes to a QMP Message
530 # 2. copy Message objects so that we assign an ID only to the copy.
531 msg = Message(msg)
551 async def execute_msg(self, msg: Message) -> object: argument
555 :param msg: The QMP `Message` to execute.
562 If the QMP `Message` does not have either the 'execute' or
568 raise ValueError("Requires 'execute' or 'exec-oob' message")
570 # Copy the Message so that the ID assigned by _execute() is
573 msg = Message(msg)
598 oob: bool = False) -> Message:
600 Create an executable message to be sent by `execute_msg` later.
606 :return: An executable QMP `Message`.
608 msg = Message({'exec-oob' if oob else 'execute': cmd})