Commit 9a27577b authored by project's avatar project

--no commit message

--no commit message
parent 688c99ee
function execute_function(context,response){
// var job_id = context.profile.job_id;
// var transaction_id = context.profile.transaction_id;
// var param = ctx.parameter;
var job_id = context.jobconfig.job_id;
var transaction_id = context.job.transaction_id;
var param = context.jobconfig.data_in.param;
var memstore = context.job.memstore
var data = 'hello world';
setTimeout(function () {
response.success(context.jobid + ' ' + data);
}, 1000);
//memstore.setvalue('timestamp.xxx',ts)
//response.cancel();
//response.reject();
//response.error("error message")
//response.success(data);
}
......
......@@ -3,7 +3,8 @@ var DIPlugin = require('../di-plugin');
function DITask(context){
DIPlugin.call(this,context);
this.name = "http"
this.name = "http-request";
this.output_type = "text";
}
util.inherits(DITask,DIPlugin);
......
......@@ -38,11 +38,11 @@ DIResponse.prototype.success = function(data){
}
DIResponse.prototype.error = function(err){
this.handle.emit('done',response('error',data));
this.handle.emit('done',response('error',err));
}
DIResponse.prototype.cancel = function(){
this.handle.emit('done',response('cancel',null));
DIResponse.prototype.reject = function(){
this.handle.emit('done',response('reject',null));
}
function response(status,data){
......
......@@ -5,4 +5,4 @@ var di = new DITask({jobid:'j01'});
di.run();
di.on('done',function(response){
console.log('>> ' + response.data);
})
});
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