-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathev.pxd
64 lines (43 loc) · 1.23 KB
/
ev.pxd
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
cimport libev
cdef enum:
EV_NONE = libev.EV_NONE
EV_READ = libev.EV_READ
EV_WRITE = libev.EV_WRITE
cdef:
ctypedef void (*watcher_cb)(void *data, Watcher io, int revents) except *
cdef union _any_watcher:
libev.ev_watcher watcher
libev.ev_io io
libev.ev_timer timer
libev.ev_idle idle
libev.ev_signal signal
cdef class Watcher:
cdef _any_watcher _w
cdef object _cb
cdef watcher_cb _ccb
cdef void *_cpriv
cdef event_handler(self, int revents)
cpdef set_callback(self, cb)
# Set low-level C-callback, be careful
cdef set_ccallback(self, watcher_cb ccb, void *cpriv)
cpdef bint is_active(self)
cpdef bint is_pending(self)
cdef class IO(Watcher):
cpdef int fileno(self)
cpdef start(self)
cpdef stop(self)
cpdef set(self, fp, int events=*)
cdef class Timer(Watcher):
cpdef start(self)
cpdef stop(self)
cpdef set_timeout(self, float timeout, float periodic=*)
cpdef set_periodic(self, float timeout)
cpdef set_oneshot(self, float timeout)
cdef class Signal(Watcher):
cpdef start(self)
cpdef stop(self)
cpdef set(self, int signum)
cpdef double get_clocks()
cpdef sleep(double delay)
cpdef main(bint once=*)
cpdef quit()