diff --git a/RpcClient.js b/RpcClient.js index 1a091ef6e..53bef8d53 100644 --- a/RpcClient.js +++ b/RpcClient.js @@ -14,6 +14,14 @@ function ClassSpec(b) { this.user = opts.user || 'user'; this.pass = opts.pass || 'pass'; this.protocol = (opts.protocol == 'http') ? http : https; + this.batchedCalls = null; + } + + RpcClient.prototype.batch = function(batchCallback, resultCallback) { + this.batchedCalls = []; + batchCallback(); + rpc.call(this, this.batchedCalls, resultCallback); + this.batchedCalls = null; } var callspec = { @@ -90,10 +98,16 @@ function ClassSpec(b) { function generateRPCMethods(constructor, apiCalls, rpc) { function createRPCMethod(methodName, argMap) { return function() { - for (var i=0; i