3 ms·
The release notes mention the graceful shutdown of a http.Server: "The net/http package now provides an optional Server.ConnState callback to hook various phas
by frakturfreund 12y ago
The release notes mention the graceful shutdown of a http.Server:
"The net/http package now provides an optional Server.ConnState callback to hook various phases of a server connection's lifecycle (see ConnState). This can be used to implement rate limiting or graceful shutdown."
Knows anyone here a code example for this?
- lbarrow 12y agoI'm super pumped about this -- I plan to spend the weekend upgrading a graceful shutdown server I maintain to use it. https://github.com/braintree/manners https://github.com/braintree/manners
- AYBABTME 12y agoYou can look at the test: http://golang.org/src/pkg/net/http/serve_test.go?#L2309 http://golang.org/src/pkg/net/http/serve_test.go?#L2309
- mathrawka 12y agoPlease note that net/http does not implement graceful shutdown, 1.3 has made it easy to implement in your application code.
- dchest 12y agohttps://github.com/rcrowley/go-tigertonic/compare/go1.3 https://github.com/rcrowley/go-tigertonic/compare/go1.3