Commit 73df0352 authored by Kamron Aroonrua's avatar Kamron Aroonrua 💬

rpc test

parent 3b73a5d3
......@@ -28,19 +28,20 @@ var req = {
var idx = 0;
async.whilst(
function() { return idx < 10000; },
function() { return idx < 20; },
function(callback) {
req.id = idx;
caller.call(req,function(err,resp){
console.log(resp)
idx++;
callback(null);
});
},
function (err) {
if(!err){
response.success();
console.log('finish')
}else{
console.log(err);
response.error("storage error");
}
}
......
......@@ -9,7 +9,7 @@ var server = new rpcserver({
});
server.set_remote_function(function(req,callback){
callback(null,{'time':n,'data':req.d});
callback(null,{'cmd':req.command,'id':req.id});
})
server.start(function(err){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment