You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
Remove event emitters from the parser as they are overhead that is not needed
This commit is contained in:
14
index.js
14
index.js
@@ -302,18 +302,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 () {
|
||||
|
Reference in New Issue
Block a user