I have a webinterface that runs on bottle.py.
What I wan’t to do is pop up a small notification on the website if certain things happen.
I’m not sure of how to tell the client that something happend.
Should I just poll for it or is there a more elegant way ?
Since I want the notifications to appear in a timely manner i would have to poll at least every second and that sounds like a lot of load for the webserver just for notifications.
As mentionned by Joe Doherty, websockets is a solution. You may be ineterested by bottle-tornadosocket in order to run bottle on top of the Tornado web server. I didn’t try myself but it looks interesting.
However, websocket may not be available for all browsers. Using long-polling is another solution. In this case, I would recommend to look at tornadio which should be possible to use together with bottle.
I hope it helps