I even don't know how to name it...
I'm creating a django web service. User has to login. And I want to make a message system (it's more complex than messages, but the idea is similiar) - when I put sth into database table event and user_id is the same as logged - show it asap anywhere you are on web service.
I thought about django_crontab, but this has 1 min step (too long) and it can't interfere with already opened page.
I thought about xml-rpc, but I should add some javascript loop, which over and over checks some page which checks database - very resource-hungry.
I'm looked at signals, it's ok to send signal - but how to get it from web?
(if user is logged on two browsers - both should show message - if you want to ask)
I have no starting point, please help mi with start.
I thought about asynchronous xml-rpc which initiates connection, but if there's no message - there's no answer at all, but when record appears - it sents answer (if browser is already closed nothing happens). But it also should check table in loop.
Generaly it is some kind of push notification.
In stack overflow you can see it when Recent inbox message arrived the icon changes....
question from:
https://stackoverflow.com/questions/65893096/event-listener-singals-xml-rpc-cron-django 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…