isShutdown returns whether the Server is shutdown or not.
()
| 156 | |
| 157 | // isShutdown returns whether the Server is shutdown or not. |
| 158 | func (s *Server) isShutdown() bool { |
| 159 | select { |
| 160 | case <-s.lifecycleCtx.Done(): |
| 161 | return true |
| 162 | default: |
| 163 | return false |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | // Shutdown waits for all exiting in-flight requests to complete, or the context to expire, whichever comes first. |
| 168 | func (s *Server) Shutdown(ctx context.Context) error { |