isClosed returns whether the API is closed or not.
()
| 629 | |
| 630 | // isClosed returns whether the API is closed or not. |
| 631 | func (p *Server) isClosed() bool { |
| 632 | select { |
| 633 | case <-p.closeContext.Done(): |
| 634 | return true |
| 635 | default: |
| 636 | return false |
| 637 | } |
| 638 | } |
| 639 | |
| 640 | // Shutdown gracefully exists with the option to cancel the active job. |
| 641 | // If false, it will wait for the job to complete. |