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

Events are not reemited #6

Open
pavele opened this issue Oct 1, 2013 · 1 comment
Open

Events are not reemited #6

pavele opened this issue Oct 1, 2013 · 1 comment

Comments

@pavele
Copy link

pavele commented Oct 1, 2013

Hi, I was checking the implementation and there is something which looks kind of strange. What is the reason that makes you to override the emit method, isn't it just fine to subscribe on the 'error' event and then do the same thing?
Currently this stops the events so in case that I have some application logic like "redis is unavailable so do x.y.z" can't be implemented.

Thanks

@jamessharp
Copy link
Member

Yes - the error handling is pretty poor at the moment. The reason we override the emit method is so that we can stop an error propagating upwards when we want to reconnect. Without that every client using the library would have to do some form of decent error handling. What should probably happen is that we check for connection errors specifically and try a reconnect and then if that still fails raise the error.

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

No branches or pull requests

2 participants