mardi 23 juin 2020

Connecting a web interface to a C/C++ model for configuring runs and displaying results

I have a model written in C/C++ for which I'd like to make a web interface. Nothing very complicated, I just want to be able to set some parameters, run the compiled C-code and plot the results in the web.

I have some experience with Bokeh and Streamlit, and also Django. What I am wondering about though is how to connect the C-code to a webGUI/frontend. The C-code produces some textfiles with data for plotting, which I want to communicate over to the frontend and plot (ideally with Bokeh). I have a working prototype which runs the C-code with a python subprocess call and simply reads the outputted textfiles and produces the desired plots, but this will obviously not work well in a production setting as the data files would be at the risk of being overwritten by other users using the webapp at the same time.

I was wondering if I should perhaps somehow make the data accessible over a REST-api, but I have not much experience with it (yet), and am not able to tell if it is a valid approach. Perhaps something like msgpack, zeroMQ/PyZMQ may be of use? (I have never used the latter packages).

Any tips are gratefully appreciated!




Aucun commentaire:

Enregistrer un commentaire