Skip to content
Discussion options

You must be logged in to vote

When you call a method decorated by @work it will return the Worker object. You can call wait() on that worker object, which will wait for it to finished, and re-raise any exceptions.

However, if you wait for the worker in a message handler you will prevent further messages from being handled. To keep things responsive you can respond to worker events.

That said, it is generally simpler to handle any exceptions within the worker itself. i.e. catch httpx.HTTPError inside _load_url.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@TomJGooding
Comment options

TomJGooding Aug 25, 2023
Collaborator Author

@willmcgugan
Comment options

@TomJGooding
Comment options

TomJGooding Aug 25, 2023
Collaborator Author

@willmcgugan
Comment options

@TomJGooding
Comment options

TomJGooding Aug 25, 2023
Collaborator Author

Answer selected by TomJGooding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants