Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate concurrency.run_until_first_complete #1443

Merged
merged 4 commits into from Feb 14, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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

[coverage:run]
source_pkgs = starlette, tests
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 @@ -20,6 +21,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