graceful

package module
v0.0.0-...-238d2e5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2018 License: MIT Imports: 6 Imported by: 2

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)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Graceful

func Graceful(srv *http.Server, listen func(), sig ...os.Signal)

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

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL