forked from quic-go/quic-go
http3: rename Server.CloseGracefully to Shutdown (#4701)
This is more consistent with standard library naming for graceful shutdown methods for HTTP/1 and HTTP/2.
This commit is contained in:
@@ -747,10 +747,10 @@ func (s *Server) Close() error {
|
||||
return err
|
||||
}
|
||||
|
||||
// CloseGracefully shuts down the server gracefully.
|
||||
// Shutdown shuts down the server gracefully.
|
||||
// The server sends a GOAWAY frame first, then or for all running requests to complete.
|
||||
// CloseGracefully in combination with ListenAndServe() (instead of Serve()) may race if it is called before a UDP socket is established.
|
||||
func (s *Server) CloseGracefully(ctx context.Context) error {
|
||||
// Shutdown in combination with ListenAndServe() (instead of Serve()) may race if it is called before a UDP socket is established.
|
||||
func (s *Server) Shutdown(ctx context.Context) error {
|
||||
s.mutex.Lock()
|
||||
s.closed = true
|
||||
// server is never used
|
||||
|
||||
@@ -1200,7 +1200,7 @@ var _ = Describe("Server", func() {
|
||||
})
|
||||
|
||||
It("closes gracefully", func() {
|
||||
Expect(s.CloseGracefully(context.Background())).To(Succeed())
|
||||
Expect(s.Shutdown(context.Background())).To(Succeed())
|
||||
})
|
||||
|
||||
It("errors when listening fails", func() {
|
||||
|
||||
Reference in New Issue
Block a user