You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
Add option to specify whether to return strings or buffers for bulk data
This commit is contained in:
@@ -2,7 +2,10 @@ var events = require("events"),
|
||||
util = require("../util").util,
|
||||
hiredis = require("hiredis");
|
||||
|
||||
function HiredisReplyParser() {
|
||||
function HiredisReplyParser(options) {
|
||||
this.options = options || {};
|
||||
this.return_buffers = this.options.return_buffers;
|
||||
if (this.return_buffers == undefined) this.return_buffers = true;
|
||||
this.reset();
|
||||
events.EventEmitter.call(this);
|
||||
}
|
||||
@@ -14,7 +17,7 @@ exports.debug_mode = false;
|
||||
exports.type = "hiredis";
|
||||
|
||||
HiredisReplyParser.prototype.reset = function() {
|
||||
this.reader = new hiredis.Reader({ return_buffers: true });
|
||||
this.reader = new hiredis.Reader({ return_buffers: this.return_buffers });
|
||||
}
|
||||
|
||||
HiredisReplyParser.prototype.execute = function(data) {
|
||||
|
Reference in New Issue
Block a user