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

Missing Event Emitters/Listeners #10

Closed
derN3rd opened this issue Apr 9, 2018 · 2 comments
Closed

Missing Event Emitters/Listeners #10

derN3rd opened this issue Apr 9, 2018 · 2 comments

Comments

@derN3rd
Copy link

derN3rd commented Apr 9, 2018

Hey

I just wanted to ask if its possible to add event emitters so I can use them to track errors.
I'm using generic-pool to keep multiple redis connections open and I need to listen to error events to remove broken clients from the pool.

With the official redis module I can use client.on("error", cb) but there is no current solution on handy-redis.

Thanks in advance

@mmkal
Copy link
Owner

mmkal commented Jun 6, 2018

For this I'd recommend just using the underlying redis client which is exposed as client.redis.

@mmkal
Copy link
Owner

mmkal commented Aug 14, 2018

Closing - to clarify, you can just do this:

import { createHandyClient } from 'handy-redis';

const myClient = createHandyClient();
myClient.redis.on("error", cb);

@mmkal mmkal closed this as completed Aug 14, 2018
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