Parallel Graceful Shutdown in Go

Overview After using death for awhile I started to run into issues closing objects. Mainly that some poorly written code would never close and the app would hang and require me to force kill the app. This seemed like a perfect oppurtunity to use go routines and channels to solve a relatively complex threading problem. What I really want is parallel shutdown with an overall timeout that will shutdown even if something fails.

Managing Application Shutdown in Go

Overview I was looking around and couldn’t find a simple library that would manage application shutdown using signals. I decided to build a simple library to handle application shutdown and calling Close methods on structs when shutdown was signaled. It is called death. Requirements Should only need to pass the signals you want to use for shutdown. Block the application from shutting down until signal was recieved. Optionally pass structs with a Close method to cleanup objects when shutdown is signaled.