def get_data(self): print("PUBLISH TO {} {} {} ".format(self._client.uid, self.msg.topic, self.msg.payload)) if self.qos > MQTTConstants.AT_MOST_ONCE: self.msg.dup = self._client.outgoing_queue.is_sent(self.msg.id) #print("PUBLISH TO {} {} {} DUPLICATE: {}".format(self._client.uid, self.msg.topic, self.msg.payload, # self.msg.dup)) if self.qos == MQTTConstants.EXACTLY_ONCE: if self._client.outgoing_queue.is_pubconf(self.msg.id): return Pubrel.from_pub(self.msg) # potentially misleading else: return self.msg else: return self.msg
def run(self): self._client.outgoing_queue.set_pubconf(self.msg.id) self.write_to_client(Pubrel.from_pub(self.msg))