code: def _handle_qos1_message_flow(self, app_message):
          
          assert app_message.qos == QOS_1
          if app_message.puback_packet:
              raise HBMQTTException("Message '%d' has already been acknowledged" % app_message.packet_id)
          if app_message.direction == OUTGOING:
              if app_message.packet_id not in self.session.inflight_out:
                  # Store message in session
                  self.session.inflight_out[app_message.packet_id] = app_message
              if app_message.publish_packet is not None:
                  # A Publish packet has already been sent, this is a retry
                  publish_packet = app_message.build_publish_packet(dup=True)
              else:
                  publish_packet = app_message.build_publish_packet()
              # Send PUBLISH packet
              yield from self._send_packet(publish_packet)
              app_message.publish_packet = publish_packet
  
              # Wait for puback
              waiter = asyncio.Future(loop=self._loop)
              self._puback_waiters[app_message.packet_id] = waiter
              yield from waiter
              del self._puback_waiters[app_message.packet_id]
              app_message.puback_packet = waiter.result()
  
              # Discard inflight message
              del self.session.inflight_out[app_message.packet_id]
          elif app_message.direction == INCOMING:
              # Initiate delivery
              self.logger.debug("Add message to delivery")
              yield from self.session.delivered_message_queue.put(app_message)
              # Send PUBACK
              puback = PubackPacket.build(app_message.packet_id)
              yield from self._send_packet(puback)
              app_message.puback_packet = puback
docs: Handle QOS_1 application message acknowledgment
          For incoming messages, this method stores the message and reply with PUBACK
          For outgoing messages, this methods sends PUBLISH and waits for the corresponding PUBACK
          :param app_message:
          :return: