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

consumer/producer: consistent Stop() behavior #151

Open
grepory opened this issue Jul 20, 2015 · 1 comment
Open

consumer/producer: consistent Stop() behavior #151

grepory opened this issue Jul 20, 2015 · 1 comment
Labels

Comments

@grepory
Copy link

grepory commented Jul 20, 2015

While I make my messaging layer built on top of go-nsq behave consistently w.r.t. my consumer/producer stop methods, it would be nice if go-nsq's consumer/producer stop methods behaved similarly. Is there a particular reason that Consumer.Stop() is asynchronous and Producer.Stop() is synchronous?

Would a PR making them behave similarly be welcome? I'm honestly not sure which I prefer.

@mreiferson
Copy link
Member

@grepory - I would love for them to match. I prefer the synchronous API by default (and users can choose to make it async by launching goroutines).

Unfortunately, I missed this in our cleanup for go-nsq v1.0 so, at this point, it would be a breaking change. However, I've always been on the fence about naming them Stop() anyway (because it could be misconstrued to imply they can be started again), so maybe we can introduce a consistent Close() API and deprecate Stop()?

Thoughts @jehiah?

@mreiferson mreiferson changed the title Should Consumer.Stop() and Producer.Stop() behave similarly? consumer/producer: consistent Stop() behavior Jul 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants