aboutsummaryrefslogtreecommitdiffstats
path: root/python/gevent/_queue.pxd
blob: d4d9da7c8f4faa92b2600287a473bda6b60e9128 (plain)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
cimport cython
from gevent.__waiter cimport Waiter
from gevent._event cimport Event

cdef _heappush
cdef _heappop
cdef _heapify

@cython.final
cdef _safe_remove(deq, item)

@cython.final
@cython.internal
cdef class ItemWaiter(Waiter):
    cdef readonly item
    cdef readonly queue

cdef class Queue:
    cdef __weakref__
    cdef readonly hub
    cdef readonly queue

    cdef getters
    cdef putters

    cdef _event_unlock
    cdef Py_ssize_t _maxsize

    cpdef _get(self)
    cpdef _put(self, item)
    cpdef _peek(self)

    cpdef Py_ssize_t qsize(self)
    cpdef bint empty(self)
    cpdef bint full(self)

    cpdef put(self, item, block=*, timeout=*)
    cpdef put_nowait(self, item)

    cdef __get_or_peek(self, method, block, timeout)

    cpdef get(self, block=*, timeout=*)
    cpdef get_nowait(self)
    cpdef peek(self, block=*, timeout=*)
    cpdef peek_nowait(self)

    cdef _schedule_unlock(self)

@cython.final
cdef class UnboundQueue(Queue):
    pass

cdef class PriorityQueue(Queue):
    pass

cdef class LifoQueue(Queue):
    pass

cdef class JoinableQueue(Queue):
    cdef Event _cond
    cdef readonly int unfinished_tasks


cdef class Channel:
    cdef __weakref__
    cdef readonly getters
    cdef readonly putters
    cdef readonly hub
    cdef _event_unlock

    cpdef get(self, block=*, timeout=*)
    cpdef get_nowait(self)

    cdef _schedule_unlock(self)