def _process_future(self, future: "Future", timeout=None, sigint=False) -> None: try: msg = future.result(timeout) except CancelledError: # This error is raised when Task.cancel is called on # disconnect from the validator in stream.py, for # this future. LOG.error("Cancelled") return if msg is RECONNECT_EVENT: if sigint is False: LOG.info("Reregistering with validator") self._stream.wait_for_ready() self._register() else: LOG.debug(f"Received message of type: " f"{Message.MessageType.Name(msg.message_type)}") if msg.message_type == Message.PING_REQUEST: self._stream.send_back( message_type=Message.PING_RESPONSE, correlation_id=msg.correlation_id, content=PingResponse().SerializeToString(), ) return elif msg.message_type == Message.CLIENT_EVENTS: self._process(msg) return LOG.warning(f"SyncProcessor got wrong message type: " f"{Message.MessageType.Name(msg.message_type)}")
def _process_future(self, future, timeout=None, sigint=False): try: LOGGER.debug('TransactionProcessor: future.result ...', ) msg = future.result(timeout) except CancelledError: # This error is raised when Task.cancel is called on # disconnect from the validator in stream.py, for # this future. LOGGER.debug('TransactionProcessor: CancelledError') return LOGGER.debug('TransactionProcessor: _process_future msg=%s', str(msg)) if msg is RECONNECT_EVENT: if sigint is False: LOGGER.info("reregistering with validator") self._stream.wait_for_ready() self._register() else: LOGGER.debug('received message of type: %s', Message.MessageType.Name(msg.message_type)) if msg.message_type == Message.PING_REQUEST: self._stream.send_back( message_type=Message.PING_RESPONSE, correlation_id=msg.correlation_id, content=PingResponse().SerializeToString()) return self._process(msg)