code: func (h *Handler) serveStream(w http.ResponseWriter, params httprouter.Params, kind discoverd.EventKind) {
  	// Create a buffered channel to receive events.
  	ch := make(chan *discoverd.Event, StreamBufferSize)
  
  	// Subscribe to events on the store.
  	service := params.ByName("service")
  	stream := h.Store.Subscribe(service, true, kind, ch)
  
  	// Create and serve an SSE stream.
  	s := sse.NewStream(w, ch, nil)
  	s.Serve()
  	s.Wait()
  	stream.Close()
  
  	// Check if there was an error while closing.
  	if err := stream.Err(); err != nil {
  		s.CloseWithError(err)
  	}
  }
docs: // serveStream creates a subscription and streams out events in SSE format.