def socketio(request):
    """The socket.io view."""
io = request.environ['socketio']
redis_sub = redis_client().pubsub()
user = username(request.user)

def subscriber(io):
    redis_sub.subscribe(room_channel())
redis_client().publish(room_channel(), user + ' connected.')
while io.connected():
    for message in redis_sub.listen():
        if message['type'] == 'message':
            io.send(message['data'])
greenlet = Greenlet.spawn(subscriber, io)
while io.connected():
    message = io.recv()
if message:
    redis_client().publish(room_channel(), user + ': ' + message[0])
redis_client().publish(room_channel(), user + ' disconnected')
greenlet.throw(Greenlet.GreenletExit)
return HttpResponse()
Нужна помощь в понимании Comet в Python (с Django)