async_utils
zeus.util.async_utils
Utilities for asyncio.
create_task
1 |
|
Create an asyncio.Task
but ensure that exceptions are logged.
Reference: https://quantlane.com/blog/ensure-asyncio-task-exceptions-get-logged/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
coroutine |
Coroutine[Any, Any, T]
|
The coroutine to be wrapped. |
required |
logger |
Logger | None
|
The logger to be used for logging exceptions. If |
None
|
Source code in zeus/util/async_utils.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|
_handle_task_exception
1 |
|
Print out exception and tracebook when a task dies with an exception.
Source code in zeus/util/async_utils.py
51 52 53 54 55 56 57 58 59 60 |
|