Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 367 Bytes

README.md

File metadata and controls

25 lines (18 loc) · 367 Bytes

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()