gracefulshutdown

command
v0.0.0-...-1628972 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: MIT Imports: 4 Imported by: 0

README

Graceful Shutdown Example

Starts a server:

$ go run gracefulshutdown/main.go
2020/06/20 03:16:50 Listening on :8080.

Make a request:

curl "http://localhost:8080/sleep?duration=10"

And then terminate server by CTRL + C sends a signal to process:

go run gracefulshutdown/main.go 
2020/06/20 03:17:15 | 200 | 10.001813588s | GET /sleep?duration=10 HTTP/1.1
^C2020/06/20 03:17:40 Shutting down server...

Finally, curl's output is similar to the following message:

curl: (52) Empty reply from server

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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