import gevent
from gevent.queue import Queue
q = Queue()
class Queue(object):
“”"
Create a queue object with a given maximum size.
If maxsize is less than or equal to zero or None
, the queue
size is infinite.
def put(self, item, block=True, timeout=None):
"""Put an item into the queue. If optional arg block is true and timeout is None
(the default),block if necessary until a free slot is available.
q.put_nowait()
q.get()
q.get_nowait()