Skip to content

Commit

Permalink
Add more desc to util functions
Browse files Browse the repository at this point in the history
  • Loading branch information
achimnol committed May 3, 2023
1 parent 5484ebb commit 5fc8f51
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/aiotools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ async def gather_safe(
Additionally, it supports manually setting the context of each subtask.
Note that if it is cancelled from an outer scope (e.g., timeout), there
is no way to retrieve partially completed or failed results.
If you need to process them anyway, you must store the results in a

Check failure on line 93 in src/aiotools/utils.py

View workflow job for this annotation

GitHub Actions / lint (3.11)

W291 trailing whitespace

Check failure on line 93 in src/aiotools/utils.py

View workflow job for this annotation

GitHub Actions / lint (3.11)

W291 trailing whitespace
separate place in the passed coroutines or use :func:`as_completed_safe()`
instead.
.. versionadded:: 2.0
"""
tasks = []
Expand Down Expand Up @@ -119,6 +125,8 @@ async def race(
second item of the returned tuple. If all coroutines fail, it will raise an
:exc:`ExceptionGroup` to indicate the explicit failure of the entire operation.
You may use this function to implement a "happy eyeball" algorithm.
.. versionadded:: 2.0
"""
async with aclosing(as_completed_safe(coros, context=context)) as ag:
Expand Down

0 comments on commit 5fc8f51

Please sign in to comment.