Search code examples
noflo

noflo network emits start and end events multiple times


I have a simple graph below. It is a math/Add component with two numeric inputs which has its output connected to a component that just prints what it receives.

I am new to noflo and I expected to see the start and end events just once, but instead I see them twice. This happens because the sockets get connected and disconnected more than once.

Why do I see more than one start/end? Is this by design?

'use strict';

var noflo = require('noflo');
var graph = noflo.graph.createGraph('test');

graph.addNode('Add', 'math/Add');
graph.addNode('Capture', 'noflotest/CaptureValue');

graph.addEdge('Add', 'sum', 'Capture', 'in');

graph.addInitial(4, 'Add', 'addend');
graph.addInitial(3, 'Add', 'augend');

noflo.createNetwork(graph, function (network) {
    network.on('start', function (info) {
        console.log('network started', info);
    });
    network.on('end', function (info) {
        console.log('network stopped', info);
    });
});

Solution

  • Good find, @akonsu. An issue has been created: https://github.com/noflo/noflo/issues/221