1
0
mirror of https://github.com/avatao-content/test-tutorial-framework synced 2025-04-03 10:12:41 +00:00
2019-06-04 13:59:32 +02:00

25 lines
544 B
Python

from signal import signal, SIGTERM, SIGINT
from tornado.ioloop import IOLoop
from tfw.event_handlers import EventHandlerBase
from tfw.components import PipeIOEventHandler
if __name__ == '__main__':
pipe_io = PipeIOEventHandler(
'',
'/tmp/tfw_send',
'/tmp/tfw_recv'
)
event_handlers = EventHandlerBase.get_local_instances()
def stop(sig, frame):
for eh in event_handlers:
eh.stop()
exit(0)
signal(SIGTERM, stop)
signal(SIGINT, stop)
IOLoop.instance().start()