New initializes GracefulShutdown.
()
| 229 | |
| 230 | // New initializes GracefulShutdown. |
| 231 | func New() *GracefulShutdown { |
| 232 | return &GracefulShutdown{ |
| 233 | callbacks: make([]ShutdownCallback, 0, 10), |
| 234 | managers: make([]ShutdownManager, 0, 3), |
| 235 | } |
| 236 | } |
| 237 | |
| 238 | // Start calls Start on all added ShutdownManagers. The ShutdownManagers |
| 239 | // start to listen to shutdown requests. Returns an error if any ShutdownManagers |
no outgoing calls