Need help with go-graceful-restart-example?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.
Scalingo

Description

Example of server with graceful restart enable

420 Stars 89 Forks BSD 2-Clause "Simplified" License 5 Commits 2 Opened issues

Services available

Need anything else?

Server graceful restart with Go

Install and run the server

$ go get github.com/Scalingo/go-graceful-restart-example
$ go-graceful-restart-example
2014/12/14 20:26:42 [Server - 4301] Listen on [::]:12345
[...]

Connect with the client

$ cd $GOPATH/src/github.com/Scalingo/go-graceful-restart-example/client
$ go run pong.go

Graceful restart

# The server pid is included in its log, in the example: 4301

$ kill -HUP

Stop with timeout

Let 10 seconds for the current requests to finish.

$ kill -TERM 

Gist of output

https://gist.github.com/Soulou/7ca6a2d4f475f8e2345e

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.