open-aviation / tangram

An open platform for modular, real-time aviation research
GNU Affero General Public License v3.0
7 stars 1 forks source link

Plugins/rs1090 publish url conf #8

Closed emctoo closed 5 months ago

emctoo commented 5 months ago

Add another conf environment variable and resolve https://github.com/open-aviation/tangram/issues/6.

xoolive commented 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)

emctoo commented 5 months ago

@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.