gograce

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: Apache-2.0 Imports: 7 Imported by: 11

README

gograce

Small lib to help with golang graceful http server shutdown

requires golang 1.8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServerWithTimeout

func NewServerWithTimeout(t ...time.Duration) (*http.Server, chan struct{})

NewServerWithTimeout takes 1 or 2 arguments. The first one is how long the webservers will wait to process current requests. The second is how long it will wait after getting signal before telling the webserver to start shutdown. This is useful for when running in kubernetes and instead of adding a preStop sleep to the pod in order to let the ingress controller update it's backends before the service stops accepting new requests.

Types

This section is empty.

Jump to

Keyboard shortcuts

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