Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Add loop helpers and simplify deploy example #46
Conversation
| -loop.set_debug(False) | ||
| -loop.create_task(run()) | ||
| -loop.run_forever() | ||
| +loop.run(main) |
|
The interrupt handling doesn't work like I expected and we get a bunch of error dumps. Also now getting an error on normal run that I don't understand:
|
| + loop.set_debug(debug) | ||
| + if interruptable: | ||
| + for signame in ('SIGINT', 'SIGTERM'): | ||
| + loop.add_signal_handler(getattr(signal, signame), stop_loop) |
|
I don't really understand the "signal handler must be callable" error either. Regarding errors at termination, I assume those are coming from still-running coroutines. You'll always get tracebacks if you stop the loop while any coroutines are still running. You can try canceling all running coroutines in your signal handler. |
|
@tvansteenburgh I tried cancelling the coroutines in various ways but couldn't avoid the errors, which is actually why I had the separate |
|
I got it working gracefully and (had to) boiled it down to a single helper function instead of split across three. |
|
LGTM, thanks @johnsca |
johnsca commentedJan 12, 2017
No description provided.