Closed emctoo closed 5 months ago
Thanks, but I don't understand why we can't reuse the port number from the running application? (without an environment variable)
@xoolive good observations!
Yes, that totally makes sense as the plugin, for now, is actually a FastAPI sub application. I expect host/port would be exported to sub application explicitly or by environment variables. Or, perhaps directly call the API handler by function.
I explore more into it, but turn out there's no easy way to do that.
So I streamlined the process and now just call the websocket publish function from plugins. The publish_any function is not coupled with FastAPI web stack, which makes it very convenient to use it from anywhere.
With server-side data delivery in place, exploring the possibility of client-initiated function call might be worthwhile, some kinds of RPC registration.
Add another conf environment variable and resolve https://github.com/open-aviation/tangram/issues/6.