Skip to content
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

Closed
gopherbot opened this issue Nov 11, 2009 · 9 comments
Closed

support for signal handling #71

gopherbot opened this issue Nov 11, 2009 · 9 comments

Comments

@gopherbot
Copy link
Contributor

by nathanollerenshaw:

go needs to be able to set signal handlers. Should be obvious why :)
@rsc
Copy link
Contributor

rsc commented Nov 11, 2009

Comment 1:

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.

@gopherbot
Copy link
Contributor Author

Comment 2 by gduffy:

Is creating network servers/clients not a priority for Go? SIGPIPE makes things a little 
difficult right now.

@rsc
Copy link
Contributor

rsc commented Nov 17, 2009

Comment 3:

SIGPIPE is handled and turns into an EPIPE returned from Write.

Owner changed to r...@golang.org.

@miekg
Copy link
Contributor

miekg commented Nov 19, 2009

Comment 4:

I'm sure you guys already thought of this and shot it down. But can't signals
be delivered by means of a int channel?

@dsymonds
Copy link
Contributor

Comment 5:

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.

@gopherbot
Copy link
Contributor Author

Comment 6 by nathanollerenshaw:

I'm ambivalent. Either way looks good to me.

@rsc
Copy link
Contributor

rsc commented Dec 2, 2009

Comment 7:

Status changed to Started.

@rsc
Copy link
Contributor

rsc commented Dec 2, 2009

Comment 8:

Labels changed: added packagechange.

@rsc
Copy link
Contributor

rsc commented Dec 16, 2009

Comment 9:

This issue was closed by revision b586649.

Status changed to Fixed.

Merged into issue #-.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc removed their assignment Jun 22, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants