1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

Merge pull request #825 from fintura/emitter

Remove event emitters from the parsers
This commit is contained in:
Ruben Bridgewater
2015-09-12 19:15:38 +02:00
4 changed files with 7 additions and 33 deletions

View File

@@ -301,18 +301,8 @@ RedisClient.prototype.init_parser = function () {
this.reply_parser = new this.parser_module.Parser({
return_buffers: self.options.return_buffers || self.options.detect_buffers || false
});
// "reply error" is an error sent back by Redis
this.reply_parser.on("reply error", function (reply) {
self.return_error(reply);
});
this.reply_parser.on("reply", function (reply) {
self.return_reply(reply);
});
// "error" is bad. Somehow the parser got confused. It'll try to reset and continue.
this.reply_parser.on("error", function (err) {
self.emit("error", new Error("Redis reply parser error: " + err.stack));
});
this.reply_parser.send_error = this.return_error.bind(self);
this.reply_parser.send_reply = this.return_reply.bind(self);
};
RedisClient.prototype.on_ready = function () {