code: func (b *GRPCBroker) AcceptAndServe(id uint32, s func([]grpc.ServerOption) *grpc.Server) {
  	listener, err := b.Accept(id)
  	if err != nil {
  		log.Printf("[ERR] plugin: plugin acceptAndServe error: %s", err)
  		return
  	}
  	defer listener.Close()
  
  	var opts []grpc.ServerOption
  	if b.tls != nil {
  		opts = []grpc.ServerOption{grpc.Creds(credentials.NewTLS(b.tls))}
  	}
  
  	server := s(opts)
  
  	// Here we use a run group to close this goroutine if the server is shutdown
  	// or the broker is shutdown.
  	var g run.Group
  	{
  		// Serve on the listener, if shutting down call GracefulStop.
  		g.Add(func() error {
  			return server.Serve(listener)
  		}, func(err error) {
  			server.GracefulStop()
  		})
  	}
  	{
  		// block on the closeCh or the doneCh. If we are shutting down close the
  		// closeCh.
  		closeCh := make(chan struct{})
  		g.Add(func() error {
  			select {
  			case <-b.doneCh:
  			case <-closeCh:
  			}
  			return nil
  		}, func(err error) {
  			close(closeCh)
  		})
  	}
  
  	// Block until we are done
  	g.Run()
  }
docs: // AcceptAndServe is used to accept a specific stream ID and immediately
  // serve a gRPC server on that stream ID. This is used to easily serve
  // complex arguments. Each AcceptAndServe call opens a new listener socket and
  // sends the connection info down the stream to the dialer. Since a new
  // connection is opened every call, these calls should be used sparingly.
  // Multiple gRPC server implementations can be registered to a single
  // AcceptAndServe call.