equal
deleted
inserted
replaced
18 Arguments: |
18 Arguments: |
19 base - event_base to use for this event |
19 base - event_base to use for this event |
20 fd - OS file descriptor to watch, or -1 |
20 fd - OS file descriptor to watch, or -1 |
21 events - bitmask of EV_* flags that represents the events to wait for |
21 events - bitmask of EV_* flags that represents the events to wait for |
22 |
22 |
23 When the event fires, it will "call" this event object. See __call__(). |
23 When the event fires, it will "call" this event object (see docs for __call__()). |
|
24 |
|
25 The lifetime of event objects is slightly non-trivial, in that they will actually hold a reference to |
|
26 themselves while "active". In other words, .add() will aquire an internal reference, which will be released |
|
27 before the __call__(). |
24 """ |
28 """ |
25 |
29 |
26 # the underlying event object |
30 # the underlying event object |
27 cdef lib.event *ev |
31 cdef lib.event *ev |
28 |
32 |
|
33 # slightly different meaning from libevent's "active", this is used to track our own refcount |
|
34 cdef readonly bool alive |
|
35 |
|
36 # self-refcount scheme |
|
37 cdef object _mark (self) |
|
38 cdef object _unmark (self) |
|
39 |
|
40 # methods also used internally |
|
41 cpdef pending (self, short mask = ?) |