mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Add send to input handler signature
This commit is contained in:
@@ -137,7 +137,11 @@ Node.prototype._emitInput = function(arg) {
|
||||
var node = this;
|
||||
if (node._inputCallback) {
|
||||
try {
|
||||
node._inputCallback(arg,function(err) { node._complete(arg,err); });
|
||||
node._inputCallback(
|
||||
arg,
|
||||
function() { node.send.apply(node,arguments) },
|
||||
function(err) { node._complete(arg,err); }
|
||||
);
|
||||
} catch(err) {
|
||||
node.error(err,arg);
|
||||
}
|
||||
@@ -149,12 +153,16 @@ Node.prototype._emitInput = function(arg) {
|
||||
c++;
|
||||
}
|
||||
try {
|
||||
node._inputCallbacks[i](arg,function(err) {
|
||||
c--;
|
||||
if (c === 0) {
|
||||
node._complete(arg,err);
|
||||
node._inputCallbacks[i](
|
||||
arg,
|
||||
function() { node.send.apply(node,arguments) },
|
||||
function(err) {
|
||||
c--;
|
||||
if (c === 0) {
|
||||
node._complete(arg,err);
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
} catch(err) {
|
||||
node.error(err,msg);
|
||||
}
|
||||
|
Reference in New Issue
Block a user