equal
deleted
inserted
replaced
7 cdef class event_base : |
7 cdef class event_base : |
8 """ |
8 """ |
9 An event_base stores the "global" state associated with events - it holds a set of events (pending/active/scheduled), |
9 An event_base stores the "global" state associated with events - it holds a set of events (pending/active/scheduled), |
10 and uses some specific multiplexing method (select/poll/epoll/kqueue/etc) to drive these events. |
10 and uses some specific multiplexing method (select/poll/epoll/kqueue/etc) to drive these events. |
11 |
11 |
12 Constructs a new event_base with default parameters. |
12 |
|
13 *** POSIX Signal Handling *** |
13 |
14 |
14 XXX: you must keep a reference to the event_base around yourself! |
|
15 XXX: what happens to events once we are destructed? |
|
16 |
|
17 Libevent has its own asynchronous signal-handling mechanism that is incompatible with Python's signal-handling |
15 Libevent has its own asynchronous signal-handling mechanism that is incompatible with Python's signal-handling |
18 mechanism. |
16 mechanism. |
19 |
17 |
20 Technical details: |
18 Technical details: |
21 Python's signal handlers will simply set a flag corresponding to the signal, and wait for |
19 Python's signal handlers will simply set a flag corresponding to the signal, and wait for |
29 handling works. |
27 handling works. |
30 |
28 |
31 This means that python's default signals and any other signals added using the signal module continue to work |
29 This means that python's default signals and any other signals added using the signal module continue to work |
32 at the cost of some additional complexity, but any libevent signal-events also work as well :) |
30 at the cost of some additional complexity, but any libevent signal-events also work as well :) |
33 |
31 |
34 XXX: currently, you can only have one event_base at a time - there should be separate types used for the main |
32 *** TODO *** |
|
33 |
|
34 Currently, you can only have one event_base at a time - there should be separate types used for the main |
35 thread and sub-threads, since the python signal handling mechanism only works in the main thread. |
35 thread and sub-threads, since the python signal handling mechanism only works in the main thread. |
36 |
36 |
37 XXX: the propagate-exceptions doesn't actually work either, it just aborts the event loop :) |
37 The propagate-exceptions doesn't actually work either, it just aborts the event loop :) |
38 |
38 |
39 XXX: add support for event_config! |
39 Support for event_config! |
40 XXX: add support for event_base_priority_init! |
40 Support for event_base_priority_init! |
41 |
|
42 """ |
41 """ |
43 |
42 |
44 # the underlying ev_base object |
43 # the underlying ev_base object |
45 cdef lib.event_base *ev_base |
44 cdef lib.event_base *ev_base |
46 |
45 |