def on_message_received(self, message): """ This is the callback from the protocol. """ log_message(self._logger.info, self.name, message, 'message received') # forward the message to the queue only if not a # heartbeat/testrequest if message.msg_type() not in {FIX.HEARTBEAT, FIX.TEST_REQUEST}: self.queue.add(message)
def on_message_received(self, message): """ This is the callback from the protocol. """ log_message(self._logger.info, self.name, message, "message received") # forward the message to the queue only if not a # heartbeat/testrequest if message.msg_type() not in {FIX.HEARTBEAT, FIX.TEST_REQUEST}: self.queue.add(message)
def send_message(self, message): """ This is the callback from the protocol. Send the message onto through the transport. """ self.protocol.prepare_send_message(message) data = message.to_binary() log_message(self._logger.info, self.name, message, 'message sent') if self.transport is not None: reactor.callFromThread(self.transport.write, data)
def send_message(self, message): """ This is the callback from the protocol. Send the message onto through the transport. """ self.protocol.prepare_send_message(message) data = message.to_binary() log_message(self._logger.info, self.name, message, "message sent") if self.transport is not None: reactor.callFromThread(self.transport.write, data)