code: func Run(engine *Engine, protocol string) (string, chan struct{}, chan struct{}) {
  	// launch server
  	server, err := transport.Launch(protocol + "://localhost:0")
  	if err != nil {
  		panic(err)
  	}
  
  	// prepare channels
  	quit := make(chan struct{})
  	done := make(chan struct{})
  
  	// start accepting connections
  	engine.Accept(server)
  
  	// prepare shutdown
  	go func() {
  		// wait for signal
  		<-quit
  
  		// errors from close are ignored
  		_ = server.Close()
  
  		// close broker
  		engine.Close()
  
  		close(done)
  	}()
  
  	// get random port
  	_, port, _ := net.SplitHostPort(server.Addr().String())
  
  	return port, quit, done
  }
docs: // Run runs the passed engine on a random available port and returns a channel
  // that can be closed to shutdown the engine. This method is intended to be used
  // in testing scenarios.