-
Notifications
You must be signed in to change notification settings - Fork 17
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
Refresh the component graph (and pipeline formulas) when it is updated #1079
Comments
Some historical comments present in an old internal issue about this (so they doesn't get lost, but take with a grain of salt because they could be very outdated): From @ela-kotulska-frequenz, dated Aug/Sep 2022: Component graph can change anytime. python-sdk should handle it and refresh the api.
RequirementsWatch for changes in component graph. When the component graph will change we should notify all actors about that. Problem 1
Solution Microgrid_api should be an actor that waits fro changes in component graph. If there is a change it should update component graph (if possible) and send to the actors that component graph has been changed. MicrogridApi should notify the actors about the change using channels.
Problems with both solutions: microgrid_api would be the only actor that can be called directly (it has method microgrid_api, component_graph). Problem 2
Problem 2We decided to:
Because other solution require synchronization. For example: Cloud sync can change sdk config file before the microgrid API with change component graph. Footnotes
|
What's needed?
We need to be able to pick up and adapt to changes in the component graph dynamically. This means we need to rebuild formulas in the data pipeline and power manager (at least) to accommodate to the new graph.
Proposed solution
Alternatives
Polling
The solution we can implement now would be to poll the microgrid API (fetch components and connections) every some amount of time, compare the new component graph to the current one, and trigger an update if it changed.
Event based
We could have a more efficient way to detect changes if the microgrid API is extended to add an RPC that streams updates to the component graph.
Updates
We would need to update all the affected formulas in the data pipeline, like formulas in
*Pool
s, etc. and the power manager to also adapt to the new graph.The text was updated successfully, but these errors were encountered: