File: Queue.py

package info (click to toggle)
python-eventlet 0.40.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,200 kB
  • sloc: python: 25,101; sh: 78; makefile: 31
file content (33 lines) | stat: -rw-r--r-- 789 bytes parent folder | download | duplicates (3)
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