code: func ReceiveMessage(config *Config, topic string, qos packet.QOS, timeout time.Duration) (*packet.Message, error) {
  	// create client
  	client := New()
  
  	// connect to broker
  	future, err := client.Connect(config)
  	if err != nil {
  		return nil, err
  	}
  
  	// wait for future
  	err = future.Wait(timeout)
  	if err != nil {
  		return nil, err
  	}
  
  	// create channel
  	msgCh := make(chan *packet.Message)
  	errCh := make(chan error)
  
  	// set callback
  	client.Callback = func(msg *packet.Message, err error) error {
  		if err != nil {
  			errCh <- err
  			return nil
  		}
  
  		msgCh <- msg
  		return nil
  	}
  
  	// make subscription
  	subscribeFuture, err := client.Subscribe(topic, qos)
  	if err != nil {
  		return nil, err
  	}
  
  	// wait for future
  	err = subscribeFuture.Wait(timeout)
  	if err != nil {
  		return nil, err
  	}
  
  	// prepare message
  	var msg *packet.Message
  
  	// wait for error, message or timeout
  	select {
  	case err = <-errCh:
  		return nil, err
  	case msg = <-msgCh:
  	case <-time.After(timeout):
  	}
  
  	// disconnect
  	err = client.Disconnect()
  	if err != nil {
  		return nil, err
  	}
  
  	return msg, nil
  }
docs: // ReceiveMessage will connect to the specified broker and issue a subscription
  // for the specified topic and return the first message received.