MCPcopy
hub / github.com/grpc/grpc-go / GracefulStop

Method GracefulStop

server.go:1950–1952  ·  view source on GitHub ↗

GracefulStop stops the gRPC server gracefully. It stops the server from accepting new connections and RPCs and blocks until all the pending RPCs are finished.

()

Source from the content-addressed store, hash-verified

1948// accepting new connections and RPCs and blocks until all the pending RPCs are
1949// finished.
1950func (s *Server) GracefulStop() {
1951 s.stop(true)
1952}
1953
1954func (s *Server) stop(graceful bool) {
1955 s.quit.Fire()

Callers 3

TestGracefulStopMethod · 0.95
mainFunction · 0.95

Calls 1

stopMethod · 0.95

Tested by 2

TestGracefulStopMethod · 0.76