You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-09 00:22:08 +03:00
Refactor command parsing
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
var commands = require('redis-commands');
|
||||
var Multi = require('./multi');
|
||||
var RedisClient = require('../').RedisClient;
|
||||
var Command = require('./command');
|
||||
|
||||
// TODO: Rewrite this including the invidual commands into a Commands class
|
||||
// that provided a functionality to add new commands to the client
|
||||
@@ -42,7 +43,7 @@ commands.list.forEach(function (command) {
|
||||
arr[i] = arguments[i];
|
||||
}
|
||||
}
|
||||
return this.internal_send_command(command, arr, callback);
|
||||
return this.internal_send_command(new Command(command, arr, callback));
|
||||
};
|
||||
Object.defineProperty(RedisClient.prototype[command], 'name', {
|
||||
value: command
|
||||
@@ -82,7 +83,7 @@ commands.list.forEach(function (command) {
|
||||
arr[i] = arguments[i];
|
||||
}
|
||||
}
|
||||
this.queue.push([command, arr, callback]);
|
||||
this.queue.push(new Command(command, arr, callback));
|
||||
return this;
|
||||
};
|
||||
Object.defineProperty(Multi.prototype[command], 'name', {
|
||||
|
Reference in New Issue
Block a user