code: def deliver_message(self, timeout=None):
          
          deliver_task = asyncio.ensure_future(self._handler.mqtt_deliver_next_message(), loop=self._loop)
          self.client_tasks.append(deliver_task)
          self.logger.debug("Waiting message delivery")
          done, pending = yield from asyncio.wait([deliver_task], loop=self._loop, return_when=asyncio.FIRST_EXCEPTION, timeout=timeout)
          if deliver_task in done:
              if deliver_task.exception() is not None:
                  # deliver_task raised an exception, pass it on to our caller
                  raise deliver_task.exception()
              self.client_tasks.pop()
              return deliver_task.result()
          else:
              #timeout occured before message received
              deliver_task.cancel()
              raise asyncio.TimeoutError
docs: Deliver next received message.
  
              Deliver next message received from the broker. If no message is available, this methods waits until next message arrives or ``timeout`` occurs.
  
              This method is a *coroutine*.
  
              :param timeout: maximum number of seconds to wait before returning. If timeout is not specified or None, there is no limit to the wait time until next message arrives.
              :return: instance of :class:`hbmqtt.session.ApplicationMessage` containing received message information flow.
              :raises: :class:`asyncio.TimeoutError` if timeout occurs before a message is delivered