Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nasa9084/syg
very simple signal-callback mapper
https://github.com/nasa9084/syg
go golang signal signal-processing
Last synced: 11 days ago
JSON representation
very simple signal-callback mapper
- Host: GitHub
- URL: https://github.com/nasa9084/syg
- Owner: nasa9084
- License: mit
- Created: 2018-02-28T02:44:37.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-21T11:53:03.000Z (over 4 years ago)
- Last Synced: 2024-10-05T00:40:52.316Z (about 1 month ago)
- Topics: go, golang, signal, signal-processing
- Language: Go
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# syg
[![Build Status](https://travis-ci.org/nasa9084/syg.svg?branch=master)](https://travis-ci.org/nasa9084/syg)
[![GoDoc](https://godoc.org/github.com/nasa9084/syg?status.svg)](https://godoc.org/github.com/nasa9084/syg)
-----a very simple signal handler for golang
## SYNOPSIS
``` go
func ExampleSyg() {
s := &http.Server{}
waitCh := make(chan struct{})syg.Listen(func(os.Signal) {
s.Shutdown(context.Background())
close(waitCh)
}, os.Interrupt)if err := s.ListenAndServe(); err != http.ErrServerClosed {
// some error handling
}
<-waitCh
}
```