This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
from collections.abc import Coroutine | |
from typing import Any | |
async def gather_limit( | |
*tasks: Coroutine[None, None, Any], | |
return_exceptions: bool = False, | |
max_con: int = 100, | |
) -> Any: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
from collections.abc import Coroutine | |
from typing import Any, TypeVar | |
T = TypeVar("T") | |
def swait(awaitable: Coroutine[Any, Any, T]) -> T: | |
"""Wait but for in syncronous function. |