Pergunta

My goal is to have a Python application that runs a web server which hosts the user interface, and based on interactions from a user in their browser, long running tasks get kicked off and through some process, feed status information back to the web server and subsequently back to the browser.

The application will not need to be used by more than 1 person at a time, and if 2 or more users are accessing the URL, the state should essentially be shared across all instances. That is, each user does not have unique login session.

The main purpose of the application will be to maintain a list of devices it discovers automatically on the network, and poll those devices every 30-60 seconds and update the UI if it is being used. In addition, the user can select one or more of those devices and issue commands or upgrade their software. In the instance of the software upgrade, I would like to have it responsive enough where I could show real time progress bars for each device showing what % of the firmware has been uploaded.

My initial thought is something like web.py or Cherrypy for the GUI, now I'm just stuck on the best method to kick off those processes from the web server and how to feed the info back. I was thinking of having some daemon listen for commands on a socket which the web app would send, and it would use sockets to pass state back and forth between the daemon and the web. Then I still need to get that information smoothly from web to client so I was thinking of websockets for that.

I'm just looking for recommendations on some good practices for having the web interface communicate back and forth between the actual workers and then how to get the data from worker to web server to client browser.

The driving forces behind using the browser based approach is that the system itself must run on low cost hardware running Linux on x86 (not arm) with small amounts of memory. It could be a GUI app which we VNC into a machine to use but the headless method seemed better to me. I'm not 100% tied to this idea if anyone can suggest better alternatives.

Nenhuma solução correta

Licenciado em: CC-BY-SA com atribuição
scroll top