-
Notifications
You must be signed in to change notification settings - Fork 17.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support for signal handling #71
Labels
Comments
That's certainly true. Thanks for creating an issue to track this. I don't know that we'll get to it quickly. Signals and threads combine for quite a bit of complexity, and then on top of that, individual goroutines can migrate between threads. Once the current volume dies down on the mailing list, it might be nice to discuss what the signal handling should look like in Go. Status changed to Thinking. |
SIGPIPE is handled and turns into an EPIPE returned from Write. Owner changed to r...@golang.org. |
That's one approach. We'd probably want something like: var Signal = make(map[int] chan int) That way you could wait for just the particular signal(s) you want, so you could have a goroutine running a function looking like: func signalWatcher() { <-os.Signal[syscall.SIGHUP]; // wait for hangup signal // do some clean up } Another approach would be a registry similar to what's found in the 'rpc' or 'http' package where you'd pass a function that you want called when a particular signal arrives. This more closely follows the traditional signal() C syscall. |
This issue was closed by revision b586649. Status changed to Fixed. Merged into issue #-. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by nathanollerenshaw:
The text was updated successfully, but these errors were encountered: