mirror of
https://github.com/golang/go
synced 2024-11-19 14:24:47 -07:00
net/http: mention RegisterOnShutdown in Server.Shutdown docs
Closes #21637 Change-Id: Icc3528572ea2a25e62757cc8fbbb9c3fa96a78b2 Reviewed-on: https://go-review.googlesource.com/59350 Reviewed-by: Tom Bergan <tombergan@google.com>
This commit is contained in:
parent
a2f22a6803
commit
c875cea7ae
@ -2487,7 +2487,8 @@ var shutdownPollInterval = 500 * time.Millisecond
|
||||
// Shutdown does not attempt to close nor wait for hijacked
|
||||
// connections such as WebSockets. The caller of Shutdown should
|
||||
// separately notify such long-lived connections of shutdown and wait
|
||||
// for them to close, if desired.
|
||||
// for them to close, if desired. See RegisterOnShutdown for a way to
|
||||
// register shutdown notification functions.
|
||||
func (srv *Server) Shutdown(ctx context.Context) error {
|
||||
atomic.AddInt32(&srv.inShutdown, 1)
|
||||
defer atomic.AddInt32(&srv.inShutdown, -1)
|
||||
|
Loading…
Reference in New Issue
Block a user