Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
N
node-bigstream
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bs
node-bigstream
Commits
9a27577b
Commit
9a27577b
authored
Dec 13, 2016
by
project
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
688c99ee
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
12 deletions
+14
-12
execute.js
plugins/di/di-http-request/execute.js
+8
-7
index.js
plugins/di/di-http-request/index.js
+2
-1
di-plugin.js
plugins/di/di-plugin.js
+3
-3
testdi.js
test/testdi.js
+1
-1
No files found.
plugins/di/di-http-request/execute.js
View file @
9a27577b
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);
}
...
...
plugins/di/di-http-request/index.js
View file @
9a27577b
...
...
@@ -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
);
...
...
plugins/di/di-plugin.js
View file @
9a27577b
...
...
@@ -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
){
...
...
test/testdi.js
View file @
9a27577b
...
...
@@ -5,4 +5,4 @@ var di = new DITask({jobid:'j01'});
di
.
run
();
di
.
on
(
'done'
,
function
(
response
){
console
.
log
(
'>> '
+
response
.
data
);
})
})
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment