github.com/blend/go-sdk@v1.20220411.3/graceful/shutdown.go (about)

     1  /*
     2  
     3  Copyright (c) 2022 - Present. Blend Labs, Inc. All rights reserved
     4  Use of this source code is governed by a MIT license that can be found in the LICENSE file.
     5  
     6  */
     7  
     8  package graceful
     9  
    10  // Shutdown racefully stops a set hosted processes based on SIGINT or SIGTERM received from the os.
    11  // It will return any errors returned by Start() that are not caused by shutting down the server.
    12  // A "Graceful" processes *must* block on start.
    13  func Shutdown(hosted ...Graceful) error {
    14  	return ShutdownBySignal(hosted,
    15  		OptDefaultShutdownSignal(),
    16  	)
    17  }