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

runtime.isStarted returns true before flows are loaded #902

Closed
gavinhungry opened this issue Jun 7, 2016 · 2 comments
Closed

runtime.isStarted returns true before flows are loaded #902

gavinhungry opened this issue Jun 7, 2016 · 2 comments

Comments

@gavinhungry
Copy link

The start and stop methods for the runtime object set the value of started before the actual flows are started (or even loaded) or stopped. This results in isStarted returning true before the flows have even loaded.

The value should be set after the startFlows/stopFlows promises resolve to avoid this issue, unless there is a reason for it to behave this way?

runtime.start:
https://github.com/node-red/node-red/blob/0.13.4/red/runtime/index.js#L146,L147

runtime.stop:
https://github.com/node-red/node-red/blob/0.13.4/red/runtime/index.js#L179,L180

@knolleary
Copy link
Member

The runtime being started means it has completed loading the node definitions etc and is ready to start running a flow and processing runtime api requests. This is separate to the current flow running. For example, if the current flow requires a node that is not known to the runtime, it will block running the flow. However the api will be available to update the flow.

We have #698 open to add a suitable api for knowing the flow state.

@gavinhungry
Copy link
Author

gavinhungry commented Jun 21, 2016

Thanks @knolleary,

For my purposes, it suits to just listen for the nodes-started event for now.

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

No branches or pull requests

2 participants