Skip to content

Multiple instance/runtime running at same time? #419

@linonetwo

Description

@linonetwo

I'm trying to understand how swarm control work in noflo-nodejs.

exports.startGraph = (graphPath, runtime, settings) => exports
.loadGraph({
graph: graphPath,
})
.then((graphInstance) => {
const graph = graphInstance;
graph.name = graph.name || path.basename(graphPath, path.extname(graphPath));
const graphName = `${settings.namespace}/${graph.name}`;
return runtime.graph.registerGraph(graphName, graph)
.then(() => runtime // eslint-disable-line no-underscore-dangle
.network._startNetwork(graph, graphName, 'none'))
.then(() => {
runtime.runtime.setMainGraph(graphName);
return runtime;
});
});

Here seems there is only one runtime in the nodejs server? And this singleton runtime will only have one main graph as setMainGraph is used.

So this make it seems that noflo-nodejs can only run a graph at one time, but it doesn't, so how does it do?

Background: I'm trying to run multiple graph at background in my app that embeds noflo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions