https://github.com/exfly/gracefully
go gracefully shutdown
https://github.com/exfly/gracefully
Last synced: 5 months ago
JSON representation
go gracefully shutdown
- Host: GitHub
- URL: https://github.com/exfly/gracefully
- Owner: exfly
- License: apache-2.0
- Created: 2019-05-25T01:01:07.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-25T02:14:51.000Z (about 7 years ago)
- Last Synced: 2024-06-20T10:03:44.168Z (about 2 years ago)
- Language: Go
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Gracefully [](https://travis-ci.com/exfly/gracefully) [](https://godoc.org/github.com/exfly/gracefully)
go app gracefully shutdown utils. This project is split from k8s, I want to do some progress here.
## Getting Started
```go
var stopCh = gracefully.SetupSignalHandler()
go func() {
for {
log.Println("alive...")
time.Sleep(1 * time.Second)
}
}()
<-stopCh
log.Println("gracefully shutdown")
```
### Installing
```sh
go get -u github.com/exfly/gracefully
```
## Deployment
This project is forked form k8s.
## Versioning
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/exfly/gracefully/tags).
## Authors
- **exfly** - _Initial work_ - [exfly](https://github.com/exfly)
## License
This project is licensed under the Apache v2 License - see the [LICENSE.md](LICENSE) file for details