RPKI Engine
1.0
|
Public Member Functions | |
def | __cmp__ |
def | __del__ |
def | __init__ |
def | __repr__ |
def | cancel |
def | clear |
def | errback |
def | handler |
def | is_set |
def | runq |
def | seconds_until_wakeup |
def | set |
def | set_errback |
def | set_handler |
def | trace |
Public Attributes | |
errback | |
handler | |
when | |
Static Public Attributes | |
gc_debug = False | |
Verbose chatter about timers states and garbage collection. | |
list | queue = [] |
Timer queue, shared by all timer instances (there can be only one queue). | |
run_debug = False | |
Verbose chatter about timers being run. |
Timer construct for event-driven code. It can be used in either of two ways: - As a virtual class, in which case the subclass should provide a handler() method to receive the wakup event when the timer expires; or - By setting an explicit handler callback, either via the constructor or the set_handler() method. Subclassing is probably more Pythonic, but setting an explict handler turns out to be very convenient when combined with bound methods to other objects.
def rpki::async::timer::__init__ | ( | self, | |
handler = None , |
|||
errback = None |
|||
) |
def rpki::async::timer::__repr__ | ( | self | ) |
def rpki::async::timer::cancel | ( | self | ) |
def rpki::async::timer::clear | ( | cls | ) |
Cancel every timer on the queue. We could just throw away the queue content, but this way we can notify subclasses that provide their own cancel() method.
Definition at line 239 of file async.py.
References cancel().
Referenced by rpki::x509::DER_object::__init__(), and rpki::x509::DER_object::check_auto_update().
def rpki::async::timer::errback | ( | self, | |
e | |||
) |
def rpki::async::timer::handler | ( | self | ) |
def rpki::async::timer::is_set | ( | self | ) |
def rpki::async::timer::runq | ( | cls | ) |
def rpki::async::timer::seconds_until_wakeup | ( | cls | ) |
Calculate delay until next timer expires, or None if no timers are set and we should wait indefinitely. Rounds up to avoid spinning in select() or poll(). We could calculate fractional seconds in the right units instead, but select() and poll() don't even take the same units (argh!), and we're not doing anything that hair-triggered, so rounding up is simplest.
def rpki::async::timer::set | ( | self, | |
when | |||
) |
Set a timer. Argument can be a datetime, to specify an absolute time, or a timedelta, to specify an offset time.
Definition at line 126 of file async.py.
References gc_debug, queue, trace(), and when.
Referenced by rpki::x509::DER_object::__init__().
def rpki::async::timer::set_errback | ( | self, | |
errback | |||
) |
def rpki::async::timer::set_handler | ( | self, | |
handler | |||
) |
def rpki::async::timer::trace | ( | self, | |
msg | |||
) |
rpki::async::timer::gc_debug = False [static] |
Definition at line 180 of file async.py.
Referenced by __repr__(), and handler().
rpki::async::timer::queue = [] [static] |
Timer queue, shared by all timer instances (there can be only one queue).
Definition at line 107 of file async.py.
Referenced by rpki::http::http_client::handle_connect(), is_set(), rpki::http::http_queue::return_result(), rpki::http::http_queue::send_request(), and set().
rpki::async::timer::run_debug = False [static] |
Definition at line 109 of file async.py.
Referenced by __repr__(), and set().