def handle_sub_proto_msg(self, cmd: protocol.Command, msg: protocol._DecodedMsgType) -> None: if isinstance(msg, dict): request_id = msg.get('request_id') if request_id is not None and request_id in self._pending_replies: # This is a reply we're waiting for, so we consume it by passing it to the # registered callback. callback = self._pending_replies.pop(request_id) callback(msg) return super().handle_sub_proto_msg(cmd, msg)
def handle_sub_proto_msg(self, cmd: protocol.Command, msg: protocol._DecodedMsgType) -> None: if isinstance(msg, dict): request_id = msg.get('request_id') if request_id is not None and request_id in self._pending_replies: # This is a reply we're waiting for, so we consume it by passing it to the # registered callback. callback = self._pending_replies.pop(request_id) callback(msg) return super().handle_sub_proto_msg(cmd, msg)
def handle_sub_proto_msg(self, cmd: Command, msg: protocol._DecodedMsgType) -> None: if isinstance(msg, dict): request_id = msg.get("request_id") if request_id is not None and request_id in self._pending_replies: # This is a reply we're waiting for, so we consume it by resolving the registered # future future = self._pending_replies.pop(request_id) future.set_result((cmd, msg)) return super().handle_sub_proto_msg(cmd, msg)