Esempio n. 1
0
def run():
    while True:
        try:
            event = runtime.con.wait_for_event()
        except Exception, error:
            proper_disconnect("main: %s\n" % error.__class__.__name__)

        event_handler(event)
        runtime.con.flush()

        if runtime.need_restart:
            restart()
Esempio n. 2
0
def event_sigint(signum, frame):
    proper_disconnect("received SIGINT")
    sys.exit(0)
Esempio n. 3
0
def event_sigterm(signum, frame):
    proper_disconnect("received SIGTERM")
    sys.exit(0)