Esempio n. 1
0
def main():
    log.initialize('gesvc', 'debug')
    loop = asyncio.get_event_loop()

    loop.run_until_complete(listen('127.0.0.1', 9999))

    try:
        log.info("start running....")
        loop.run_forever()
    except KeyboardInterrupt:
        loop.stop()
        log.info("Stopped....")
Esempio n. 2
0
def main():
    log.initialize('GEMINI', config.get_str('LOG_THRESHOLD'))
    log.info("Logger initialized. begin start server...")
    loop = asyncio.get_event_loop()

    try:
        loop.run_until_complete(server.init(loop))
        loop.run_forever()
    except KeyboardInterrupt:
        log.info("Received Ctrl-C signal. begin stopping...")
    finally:
        loop.run_until_complete(server.close())
        loop.close()
        log.info("Server is stopped...")