-
Notifications
You must be signed in to change notification settings - Fork 2
how to do graceful shutdown with net/http (maybe)
License
kr/httpshutdown
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
package httpshutdown
import "github.com/kr/httpshutdown"
Package httpshutdown illustrates a possible way to do graceful shutdown
with net/http. This code is untested.
TYPES
type Server struct {
Server *http.Server
// contains filtered or unexported fields
}
Serve wraps the net/http Server and performs graceful shutdown.
func (s *Server) Serve(l net.Listener) error
Serve calls Serve on the underlying http Server, but wraps l in another
net.Listener that synchronises open connections with Wait.
func (s *Server) Wait()
Wait waits for all open connections in s to close.
About
how to do graceful shutdown with net/http (maybe)
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published