Emit error event for redis connection failure
rahulbhanushali opened this issue · comments
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?
@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?
@mcollina Is it fine if I submit a PR for this issue? I also need this feature.
@jyotman please do!! Thanks!
Cool, just 2 questions -
-
I was thinking of emitting the
connect
anderror
events. Should I emit any other event too? -
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?
Yes