You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to implement Redis with django-socketio in a chat. So here is what I did:
def listener(self):
r = redis.StrictRedis()
r = r.pubsub()
r.subscribe('chat')
for m in r.listen():
message = m['data']
socket.send_and_broadcast_channel(message)
@events.on_message()
def messages(request, socket, context, message):
r = redis.Redis()
r.publish('chat', message)
But in order redis to work with gevent, we have to start a Greenlet when the user subscribes.
So we need to add something like that:
Hi,
I'm trying to implement Redis with django-socketio in a chat. So here is what I did:
But in order redis to work with gevent, we have to start a Greenlet when the user subscribes.
So we need to add something like that:
I tried to do that with django-socketio but I didn't figured how to do it.
Would you have any idea on how can I do the equivalent with django-socketio?
Thank you very much for your help.
The text was updated successfully, but these errors were encountered: