1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
from eventlet import queue
__all__ = ['Empty', 'Full', 'LifoQueue', 'PriorityQueue', 'Queue']
__patched__ = ['LifoQueue', 'PriorityQueue', 'Queue']
# these classes exist to paper over the major operational difference between
# eventlet.queue.Queue and the stdlib equivalents
class Queue(queue.Queue):
def __init__(self, maxsize=0):
if maxsize == 0:
maxsize = None
super().__init__(maxsize)
class PriorityQueue(queue.PriorityQueue):
def __init__(self, maxsize=0):
if maxsize == 0:
maxsize = None
super().__init__(maxsize)
class LifoQueue(queue.LifoQueue):
def __init__(self, maxsize=0):
if maxsize == 0:
maxsize = None
super().__init__(maxsize)
Empty = queue.Empty
Full = queue.Full
|