-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
app.getFeatures broken #1777
Comments
@panaaj any ideas? |
The issue is due to calling A work around for invoking
Will add a test to |
A real workaround is:
but it's pointless. The real code could be
but!:
In fact .getFeatures() return Promise when as the documentation says OK, if the .getFeatures() returns Promise instead result, then the code should be:
but it's get So a real real workaround is:
That is, to start the asynchronous function only on the next turn of the main cycle. |
This is kinda tricky: plugin A provides feature 1 if there is feature 2 available and feature 2 is provided by plugin B, that needs to be started. Somewhat similar to systemd dependencies with We have already a similar method for plugins to "announce" properties:
The semantic difference to regular events is that listeners get the set of all emitted values since server startup, not just single values. A poor man's event broker with retain = true, if you will. We could change the feature detection api to use app properties API, forcing plugins to react to features coming available. This would also cover the case where a plugin providing a feature is activated later, after server startup. |
Signal K Server version 2.8.3
The server plugin function app.getFeatures does not work.
Code:
Result:
The text was updated successfully, but these errors were encountered: