mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			17 lines
		
	
	
		
			366 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			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 |