Skip to content

Commit bf9917d

Browse files
committed
remove fishjam.utils.repeat_until
1 parent 6f83ea7 commit bf9917d

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

fishjam/utils.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
from asyncio import FIRST_COMPLETED, Event, ensure_future, wait
2-
from typing import (
3-
AsyncIterator,
4-
Awaitable,
5-
Callable,
6-
TypeVar,
7-
cast,
8-
)
9-
101
from fishjam.errors import MissingFishjamIdError
112

123

@@ -18,21 +9,3 @@ def get_fishjam_url(fishjam_id: str | None, fishjam_url: str | None) -> str:
189
return fishjam_url
1910

2011
return f"https://fishjam.io/api/v1/connect/{fishjam_id}"
21-
22-
23-
_T = TypeVar("_T")
24-
25-
26-
async def repeat_until(
27-
coro_fun: Callable[[], Awaitable[_T]],
28-
end_event: Event,
29-
) -> AsyncIterator[_T]:
30-
while not end_event.is_set():
31-
end_fut = ensure_future(end_event.wait())
32-
done, _ = await wait(
33-
(ensure_future(coro_fun()), end_fut), return_when=FIRST_COMPLETED
34-
)
35-
for task in done:
36-
if task is end_fut:
37-
return
38-
yield cast(_T, await task)

0 commit comments

Comments
 (0)