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 State Change Handling Feature #82
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not add the onStateChange function to the constructor?
and there should be a basic test to make sure if runs the handler function successfully and an error if the handler function fails
Added array of consumers for preventing unnecessary code duplication in beforeEach() function in consumer tests Added error handling for consumer state change function Added 2 basic tests for consumer state change
… since it breaks reconnection error handling)
…flex into feature/consumer-state-change-handler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Wouldn't it be better to emit and event instead of injecting a function? |
Probably in the long run, for now this solution functions good enough. Might be a good idea to create an issue for it so it won't be forgotten. |
implements this #81
Allow the users of this library to "listen" to change in the consumer state without needing to check at intervals.
Since this PR isn't adding anything new to the consumer's logic, but just exports some of the inners nicely, I didn't add anything tests, open for suggestions though.