我写了一个简单的问答网站练手,想实现网页实时动态消息提醒的功能。我的想法是用redis 和gevent实现,利用redis的subscribe/publish实现观察者模型,比如给每个用户建个channel, 关注用户即subscribe这个channel,每当被关注者有活动时,给每个关注者publish消息。但我要怎么实现comet的服务器推呢,无限循环?怎么整合gevent呢? 不知道我的思路是否有问题。请多指教。
光阴似箭催人老,日月如移越少年。
It’s a bit late... Since everyone is a programmer, I won’t say much. gevent-socketio is your good friend. In short, after gevent-socketio establishing the connection, run Redis PubSub in it listen() Loop
gevent-socketio
listen()
It’s a bit late... Since everyone is a programmer, I won’t say much.
gevent-socketio
is your good friend. In short, aftergevent-socketio
establishing the connection, run Redis PubSub in itlisten()
Loop