Skip to content
Tries to properly shut down a web server upon interrupts.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
README
graceful.go

README

graceful tries to properly shut down a web server upon interrupts.

Example:

	srv := &http.Server{
		Handler: http.HandlerFunc(myHandler),
	}

	graceful.Graceful(srv, func() {
		if err := srv.ListenAndServe(); err != http.ErrServerClosed {
			log.Fatal(err)
		}
	}, os.Interrupt)
You can’t perform that action at this time.