Skip to content

olxbr/go-shutdown

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-shutdown

Go shutdown helper is a library to execute graceful application shutdown. It watches multiple services and if anyone fails or is terminated, it executes everyone else's close function.

Example Usage

shutdown.Manage(graceTime).
  Listener("webserver", webserver.Start, webserver.Shutdown).
  PingCloseService("postgres", postgresClient.Ping, postgresClient.Close).
  Listen()

shutdown can manage multiple PingCloseService. All function arguments should be of type func () error.

About

Go shutdown helper

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%