Closed linspw closed 1 year ago
Thanks for the feedback! Error handling for the worker is indeed important.
Problem with setting an exception handler on the loop is that in the current implementation the channel consumer is run via channel's ASGI routing which apparently swallows and hangs on exception – at least in the way I used it.
I opened a PR #11 that skips the channel's ASGI routing and runs the consumer directly and then does exception handling similar to how you proposed it. I'll try to come up with tests for exception handling and then I'll merge it.
Great solution you implemented, the worker being linked to ASGI I don't know if it had any gain, but separate seems even better to me.
I will close this PR.
Maybe it's not the best solution, but believe me it already helps to understand the errors