loop.add_signal_handler(signal.SIGINT, foo) is not intercepting KeyboardInterrupt as in asyncio and uvloop
If I add a signal handler for SIGINT in pure asyncio and uvloop implementation, a ctrl-c is handled by the handler in contrast to tokio, where still a KeyboardInterrupt is raised.
I use Python 3.6.3 and tokio bbf9be4.
When I send SIGINT via kill -s INT <pid> tokio raises also a KeyboardInterrupt in contrast to asyncio and uvloop.
It seems that SIGINT handler is not recognized at all...
I don’t have much time, I’ll try to look into this problem next weekend.
Btw why do you use this event loop?
I develop an asyncio RPC library, which solely depends on Python >=3.5 on the remote side (lazy remote module import via MetaPathFinder): https://github.com/diefans/debellator
Just for curiosity and possible performance gains, I also try different asyncio implementations (uvloop, tokio) for the local/master side. All in all I, learn asyncio and stumble upon issues/features and so on ;)
you should just use uvloop, it is fast and python specific. tokio event loop makes sense only if you need to integration async rust code.