code: func (s *Service) dispatcher(client *Client, fail chan struct{}) bool {
  	for {
  		select {
  		case cmd := <-s.commandQueue:
  
  			// handle subscribe command
  			if cmd.subscribe {
  				f2, err := client.SubscribeMultiple(cmd.subscriptions)
  				if err != nil {
  					s.err("Subscribe", err)
  
  					// cancel future
  					cmd.future.Cancel()
  
  					return false
  				}
  
  				// bind future in a own goroutine. the goroutine will be
  				// ultimately collected when the service is stopped
  				go cmd.future.Bind(f2.(*subscribeFuture).Future)
  			}
  
  			// handle unsubscribe command
  			if cmd.unsubscribe {
  				f2, err := client.UnsubscribeMultiple(cmd.topics)
  				if err != nil {
  					s.err("Unsubscribe", err)
  
  					// cancel future
  					cmd.future.Cancel()
  
  					return false
  				}
  
  				// bind future in a own goroutine. the goroutine will be
  				// ultimately collected when the service is stopped
  				go cmd.future.Bind(f2.(*future.Future))
  			}
  
  			// handle publish command
  			if cmd.publish {
  				f2, err := client.PublishMessage(cmd.message)
  				if err != nil {
  					s.err("Publish", err)
  
  					// cancel future
  					cmd.future.Cancel()
  
  					return false
  				}
  
  				// bind future in a own goroutine. the goroutine will be
  				// ultimately collected when the service is stopped
  				go cmd.future.Bind(f2.(*future.Future))
  			}
  		case <-s.tomb.Dying():
  			// disconnect client on Stop
  			err := client.Disconnect(s.DisconnectTimeout)
  			if err != nil {
  				s.err("Disconnect", err)
  			}
  
  			return true
  		case <-fail:
  			return false
  		}
  	}
  }
docs: // reads from the queues and calls the current client