Browse Source
This is achieved by introducing a new option to the createClient method called bufferedInput. If bufferedInput is set to true, then the returned data will be a Buffer if the command argument passed is a buffer E.g. var redis = require("redis"), client = redis.createClient(<port>, <host>, {buffered_input: true}); client.set("foo_rand000000000000", "OK"); // The below get request will return a utf8 string client.get("foo_rand000000000000", function (err, reply) { console.log(reply.toString()); // Will print `OK` }); // The below get request will return a Buffer as the key is specified as a Buffer client.get(new Buffer("foo_rand000000000000"), function (err, reply) { console.log(reply.toString()); // Will print `<Buffer 4f 4b>` }); client.end();gh-pages
Dayananda Nanjundappa
13 years ago
2 changed files with 72 additions and 1 deletions
Loading…
Reference in new issue