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

buffer signal channel #66

Merged
merged 1 commit into from
May 31, 2017
Merged

buffer signal channel #66

merged 1 commit into from
May 31, 2017

Conversation

mhowlett
Copy link
Contributor

the example works as is (though maybe only 99.99% of the time?), but this tripped me up when I extended the select statement to do more things. refer to: https://golang.org/pkg/os/signal/#Notify

@edenhill
Copy link
Contributor

good catch, I'd completely missed this:

Package signal will not block sending to c: the caller must ensure that c has sufficient buffer space to keep up with the expected signal rate. For a channel used for notification of just one signal value, a buffer of size 1 is sufficient.

A bit counter-intuitive behaviour when it comes to channels..

@edenhill edenhill merged commit 3d1b9b8 into confluentinc:master May 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants