Created
June 28, 2012 18:53
-
-
Save nitesh123/3013190 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RedisClient.prototype.write = function (args,callback) { | |
var self = this; | |
this.send_command('write', to_array(arguments), function (err, res) { | |
if (err === null) { | |
} | |
if (typeof(callback) === 'function') { | |
callback(err, res); | |
} | |
}); | |
}; | |
RedisClient.prototype.WRITE = RedisClient.prototype.write; | |
----------- | |
command_obj = new Command(command, args, false, buffer_args, callback); | |
if ((!this.ready && !this.send_anyway) || !stream.writable) { | |
if (exports.debug_mode) { | |
if (!stream.writable) { | |
console.log("send command: stream is not writeable."); | |
} | |
console.log("Queueing " + command + " for next server connection."); | |
} | |
this.offline_queue.push(command_obj); | |
this.should_buffer = true; | |
return false; | |
} | |
//stream ops go here | |
if ( command === "flush") { | |
stream.write("*0\r\n\r\n"); | |
this.command_queue.push(command_obj); | |
this.commands_sent += 1; | |
return true; | |
} else if (command === "read" ) { | |
} else if (command === "write" ) { | |
var str = String(args[0]); | |
stream.write(str); | |
this.command_queue.push(command_obj); | |
this.commands_sent += 1; | |
return true; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment