Skip to content
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/aiohappyeyeballs/_staggered.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from collections.abc import Awaitable, Callable, Iterable
from typing import (
TYPE_CHECKING,
Any,
TypeVar,
)

Expand All @@ -19,13 +18,13 @@ def _set_result(wait_next: "asyncio.Future[None]") -> None:


async def _wait_one(
futures: "Iterable[asyncio.Future[Any]]",
futures: "Iterable[asyncio.Future[_T]]",
Comment thread
Dreamsorcerer marked this conversation as resolved.
loop: asyncio.AbstractEventLoop,
) -> _T:
) -> asyncio.Future[_T]:
"""Wait for the first future to complete."""
wait_next = loop.create_future()
wait_next: asyncio.Future[_T] = loop.create_future()
Comment thread
Vizonex marked this conversation as resolved.
Outdated

def _on_completion(fut: "asyncio.Future[Any]") -> None:
def _on_completion(fut: "asyncio.Future[_T]") -> None:
if not wait_next.done():
wait_next.set_result(fut)

Expand Down
Loading