Skip to content

bostin/gdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GDown

a graceful shutdown tool.

Install

go get -u github.com/bostin/gdown

Usage

// declare shutdown
ctx, cancel := context.WithCancel(context.Background())
shutdown := gdown.NewGraceful(ctx, cancel)

// register callbacks
shutdown.Register(gdown.PriorityLevel10, func() {
	// called on shutdown
})

// listening
shutdown.Listen()