-
Notifications
You must be signed in to change notification settings - Fork 442
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: add interfaces #146
Comments
@bkeroackdsc While i use something similar (see gist) I'm not convinced that this belongs in the Perhaps we could add a thoughts @mreiferson ? |
Yea, we couldn't return interfaces in the constructors without breaking compatibility, however we could introduce new interfaces that could provide a mechanism for speccing that out and being used in end-user tests? |
@mreiferson That seems like a reasonable compromise. |
@mreiferson Are those new interfaces introduced already? I have to test a method that uses DeferredPublish.. |
No, PRs welcome! |
Guys, I think you don't need to make those interfaces if you want. But, could you make a public API for change the connections instance in producer and consumer? I think the other way (alternative) to test this nsq is to implement custom net memory listener with a pipe. So, that we could implement a custom mock for the nsq. |
To facilitate testing, I've found myself abstracting out the go-nsq API so I can swap in mock implementations.
nsq.Producer/nsq.Consumer should be interfaces so that users don't have to create their own abstraction layer.
The text was updated successfully, but these errors were encountered: