Skip to content
This repository has been archived by the owner on Jun 25, 2018. It is now read-only.

loop.add_signal_handler(signal.SIGINT, foo) is not intercepting KeyboardInterrupt as in asyncio and uvloop #75

Open
diefans opened this issue Nov 16, 2017 · 3 comments

Comments

@diefans
Copy link

diefans commented Nov 16, 2017

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...

@fafhrd91
Copy link
Collaborator

I don’t have much time, I’ll try to look into this problem next weekend.

Btw why do you use this event loop?

@diefans
Copy link
Author

diefans commented Nov 17, 2017

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 ;)

@fafhrd91
Copy link
Collaborator

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants