Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

noflo.loadFile - How to know that all IIPs have been sent? #261

Closed
sjaakiejj opened this issue Sep 19, 2014 · 2 comments · Fixed by #385
Closed

noflo.loadFile - How to know that all IIPs have been sent? #261

sjaakiejj opened this issue Sep 19, 2014 · 2 comments · Fixed by #385

Comments

@sjaakiejj
Copy link

I'm currently trying to test some of my noflo graphs, but ran into an issue regarding IIPs. Some of my components take some extra parameters as IIPs, so I specify those as data packets in the JSON graph file. But noflo.loadFile returns before these packets are sent to the components. This is the order of execution that I generated by putting print statements into the noflo methods:

[TEST] Loading graph file
[NETWORK] Starting Network...
[NETWORK] Network.prototype.sendInitials called
[NETWORK] Network.prototype.sendInitials.send called
[NETWORK] Network Started
...
[NETWORK] Network.prototype.sendInitials processing initials
[NETWORK] Network.prototype.addInitial called
[NETWORK] Expecting 1 initializations
[NETWORK] Network.prototype.addInitial called
[NETWORK] Expecting 2 initializations
[TEST] Graph file returned. 2 initializations pending
...
[NETWORK] Network.prototype.sendInitials processing initials
[NETWORK] Network.prototype.sendInitials processing initials
[NETWORK] Expecting 1 initializations
[NETWORK] Expecting 0 initializations

So my question is - how do I know that all the IIPs have been sent to their associated components to ensure the system has completely started?

Right now I'm using a timeout function, but that's not exactly robust.

@jonnor
Copy link
Member

jonnor commented Sep 21, 2014

@sjaakiejj You could have a component which sends a message on outport when it receives an IIP in, and then monitor the outport. Attach this IIP at the end of the connections list.
I'm not sure if we have a better way right now. What is your usecase?

@jonnor
Copy link
Member

jonnor commented Feb 19, 2016

Ran into the same issue in noflo-runtime-msgflo now, trying to set/override some 'IIPs' after a NoFlo component has been started.
Due to the way Network.sendInitials() do work async, there is no way to know when all IIPs have been sent...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants