mirror of
https://github.com/avatao-content/test-tutorial-framework
synced 2025-06-28 21:35:12 +00:00
Add example process with PipeIO event handlers
This commit is contained in:
24
solvable/src/pipe_io_main.py
Normal file
24
solvable/src/pipe_io_main.py
Normal file
@ -0,0 +1,24 @@
|
||||
from signal import signal, SIGTERM, SIGINT
|
||||
|
||||
from tornado.ioloop import IOLoop
|
||||
|
||||
from tfw import EventHandlerBase
|
||||
from tfw.components import PipeIOEventHandler
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
ide_pipeio = PipeIOEventHandler(
|
||||
'ide',
|
||||
'/tmp/ide_send',
|
||||
'/tmp/ide_recv'
|
||||
)
|
||||
|
||||
event_handlers = EventHandlerBase.get_local_instances()
|
||||
def cleanup(sig, frame):
|
||||
for eh in event_handlers:
|
||||
eh.cleanup()
|
||||
exit(0)
|
||||
signal(SIGTERM, cleanup)
|
||||
signal(SIGINT, cleanup)
|
||||
|
||||
IOLoop.instance().start()
|
Reference in New Issue
Block a user