Skip to content

Commit

Permalink
Deprecate run_until_first_complete (#1443)
Browse files Browse the repository at this point in the history
Co-authored-by: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com>
Co-authored-by: Tom Christie <tom@tomchristie.com>
  • Loading branch information
3 people committed Feb 14, 2022
1 parent 62428c5 commit 3f6d4f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions setup.cfg
Expand Up @@ -29,6 +29,7 @@ filterwarnings=
ignore: The 'variables' alias has been deprecated. Please use 'variable_values' instead\.:DeprecationWarning
# Workaround for Python 3.9.7 (see https://bugs.python.org/issue45097)
ignore:The loop argument is deprecated since Python 3\.8, and scheduled for removal in Python 3\.10\.:DeprecationWarning:asyncio
ignore: run_until_first_complete is deprecated and will be removed in a future version.:DeprecationWarning
ignore: starlette\.middleware\.wsgi is deprecated and will be removed in a future release\.*:DeprecationWarning

[coverage:run]
Expand Down
7 changes: 7 additions & 0 deletions starlette/concurrency.py
@@ -1,6 +1,7 @@
import functools
import sys
import typing
import warnings

import anyio

Expand All @@ -15,6 +16,12 @@


async def run_until_first_complete(*args: typing.Tuple[typing.Callable, dict]) -> None:
warnings.warn(
"run_until_first_complete is deprecated "
"and will be removed in a future version.",
DeprecationWarning,
)

async with anyio.create_task_group() as task_group:

async def run(func: typing.Callable[[], typing.Coroutine]) -> None:
Expand Down

0 comments on commit 3f6d4f5

Please sign in to comment.