84669 personnes étudient
152542 personnes étudient
20005 personnes étudient
5487 personnes étudient
7821 personnes étudient
359900 personnes étudient
3350 personnes étudient
180660 personnes étudient
48569 personnes étudient
18603 personnes étudient
40936 personnes étudient
1549 personnes étudient
1183 personnes étudient
32909 personnes étudient
我写了一个简单的问答网站练手,想实现网页实时动态消息提醒的功能。我的想法是用redis 和gevent实现,利用redis的subscribe/publish实现观察者模型,比如给每个用户建个channel, 关注用户即subscribe这个channel,每当被关注者有活动时,给每个关注者publish消息。但我要怎么实现comet的服务器推呢,无限循环?怎么整合gevent呢? 不知道我的思路是否有问题。请多指教。
光阴似箭催人老,日月如移越少年。
有点晚了... 既然大家都是程序猿, 那就不多说了, gevent-socketio 是你的好朋友, 总之就是在 gevent-socketio 建立连接之后在里头跑 Redis PubSub 的 listen() 循环
gevent-socketio
listen()
有点晚了... 既然大家都是程序猿, 那就不多说了,
gevent-socketio
是你的好朋友, 总之就是在gevent-socketio
建立连接之后在里头跑 Redis PubSub 的listen()
循环