From c875cea7ae174f723aed10ea31911cd7013ee261 Mon Sep 17 00:00:00 2001 From: Artyom Pervukhin Date: Sun, 27 Aug 2017 11:30:19 +0300 Subject: [PATCH] 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 --- src/net/http/server.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/net/http/server.go b/src/net/http/server.go index 7312f4850f..cf6d2a079d 100644 --- a/src/net/http/server.go +++ b/src/net/http/server.go @@ -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) -- 2.48.1