code: func (m *MemoryBackend) Dequeue(client *Client) (*packet.Message, Ack, error) {
  	// mutex locking not needed
  
  	// get session
  	sess := client.Session().(*memorySession)
  
  	// this implementation is very basic and will dequeue messages immediately
  	// and not return no ack. messages are lost if the client fails to handle them
  
  	// get next message from queue
  	select {
  	case msg := <-sess.temporary:
  		return sess.applyQOS(msg), nil, nil
  	case msg := <-sess.stored:
  		return sess.applyQOS(msg), nil, nil
  	case <-client.Closing():
  		return nil, nil, nil
  	}
  }
docs: // Dequeue will get the next message from the temporary or stored queue.