Created
June 23, 2016 17:00
-
-
Save povilasb/a179e60b513b136c3d6f24d8bd507c1d to your computer and use it in GitHub Desktop.
Unix signal handling with python asyncio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import signal | |
import asyncio | |
def handler(): | |
print("SIGHUP") | |
ev_loop = asyncio.get_event_loop() | |
ev_loop.add_signal_handler(signal.SIGHUP, handler) | |
ev_loop.run_forever() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment