Skip to content
/ ctrlc Public

Go library that provides an easy way of having a task that is context-aware and deals with SIGINT and SIGTERM signals

License

Notifications You must be signed in to change notification settings

caarlos0/ctrlc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ctrlc

CTRL-C is a Go library that provides an easy way of having a task that is context-aware and deals with SIGINT and SIGTERM signals.

Usage

Check the _examples folder.

You can run it like this:

$ go run _examples/main.go
# will fail because the last task returns an error

$ go run _examples/main.go -timeout 1s
# will fail due to context timeout

$ go run _examples/main.go
# press ctrl-c
# will cancel the context due to interrupt and error

About

Go library that provides an easy way of having a task that is context-aware and deals with SIGINT and SIGTERM signals

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages