You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an asynchronous Python app which continual polls various rest api's with httpx
Something like
try:
async with httpx.AsyncClient() as client:
result = await client.post(url)
# Do some processing on result
except Exception as exc:
capture_exception(exc)
logger.error("There was an error exc = {0}".format(exc))
Because my application is async and busy (polling lot's of APIs and getting data) the synchronous capture_exception call causes an issue because it blocks the applications only thread. This is made worse by the fact that an rest api may start returning errors on every call causing capture_exception to block a lot of things.
Solution Brainstorm
If there was an async version of capture_exception that would make life much better
eg
try:
async with httpx.AsyncClient() as client:
result = await client.post(url)
# Do some processing on result
except Exception as exc:
await capture_exception_async(exc)
logger.error("There was an error exc = {0}".format(exc))
While capture_exception_async other asynchronous tasks can still run. Is wasn't able to find anything on this by Googling so I assume it just does not exist at the moment.
The text was updated successfully, but these errors were encountered:
Hey @mlockett42
That's a really good suggestion. We need to make the SDK support more async processing, to fully support all the async Python projects out there. I put this on our back log. (But please do not hold your breath on it, because we have a lot on our plates right now.)
Problem Statement
I have an asynchronous Python app which continual polls various rest api's with httpx
Something like
Because my application is async and busy (polling lot's of APIs and getting data) the synchronous capture_exception call causes an issue because it blocks the applications only thread. This is made worse by the fact that an rest api may start returning errors on every call causing capture_exception to block a lot of things.
Solution Brainstorm
If there was an async version of capture_exception that would make life much better
eg
While capture_exception_async other asynchronous tasks can still run. Is wasn't able to find anything on this by Googling so I assume it just does not exist at the moment.
The text was updated successfully, but these errors were encountered: