rawpython / remi

Python REMote Interface library. Platform independent. In about 100 Kbytes, perfect for your diet.
Apache License 2.0
3.48k stars 401 forks source link

[QUESTION] any example of long-polling implementation in remi? #513

Closed ztigerz closed 1 year ago

ztigerz commented 1 year ago

Hello from a newbie :).

[goal] a webpage to always keep a valid HTTP GET request to webserver (long-polling). So webserver can push data whenever ready to webpage.

[reference] I found long-polling is supported by Javascript: https://javascript.info/long-polling

[question] Is there any example of long-polling implementation in remi? Or other similar approach recommended to meet my goal?

thanks

dddomodossola commented 1 year ago

Hello @ztigerz ,

This is not required in remi. Remi automatically updates html elements that got changed on the server side. This means that, when you do something like mybutton.set_text("new text"), remi sends the message to the page immediately.

Kind Regards.