17 lines
366 B
JavaScript

class LocalRouter {
constructor() {}
send(source,destinationId,msg,next) {
var node = source._flow.getNode(destinationId);
if (node) {
setImmediate(function() {
node.receive(msg);
next();
});
} else if (next) {
next()
}
}
}
module.exports = LocalRouter