mcollina / mqemitter-redis

Redis-powered MQEmitter
MIT License
47 stars 27 forks source link

Emit error event for redis connection failure #2

Open rahulbhanushali opened 8 years ago

rahulbhanushali commented 8 years ago

Hi mcollina,

I have been using aedes for quite sometime with mqemitter-redis and aedes-persistence-redis. I am trying to handle connection issues in case the redis server goes down or there are network related issues but mqemitter-redis does not expose a method or emit an error event for connection failure.

Can you please help with this?

mcollina commented 8 years ago

@rahulbhanushali yes that is missing here.

In mqemitter-mongodb we have a status EventEmitter https://github.com/mcollina/mqemitter-mongodb/blob/master/mqemitter-mongodb.js#L32 on which these types of event are emitted.

Would you like to send a PR?

jyotman commented 7 years ago

@mcollina Is it fine if I submit a PR for this issue? I also need this feature.

mcollina commented 7 years ago

@jyotman please do!! Thanks!

jyotman commented 7 years ago

Cool, just 2 questions -

  1. I was thinking of emitting the connect and error events. Should I emit any other event too?

  2. There are 2 redis connections being made -

this.subConn = new Redis(opts)
this.pubConn = new Redis(opts)

So should I emit events from both these connections?

mcollina commented 7 years ago

Yes