Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
837 views
in Technique[技术] by (71.8m points)

notifications - event listener, singals , xml-rpc, cron django

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...