Skip to content Skip to sidebar Skip to footer

How To Implement Comet Via Gevent's Event

there's a demo on how to implement comet using gevent + flask. #coding:utf-8 ''' Created on Aug 6, 2011 @author: Alan Yang ''' import time from gevent import monkey monkey.patch_

Solution 1:

Use gevent.queue.Queue.

Reading from the Queue removes the message and if there are multiple readers, each message will be delivered to exactly one of them (which one is unspecified though, there's no randomness or fairness, it's just arbitrary).

Post a Comment for "How To Implement Comet Via Gevent's Event"