s365b.core.concurrency ====================== .. py:module:: s365b.core.concurrency .. autoapi-nested-parse:: Run a group of coroutines that live and die together. Functions --------- .. autoapisummary:: s365b.core.concurrency.all_or_cancel Module Contents --------------- .. py:function:: all_or_cancel[T](coros: collections.abc.Iterable[collections.abc.Coroutine[Any, Any, T]]) -> list[T] :async: Run coroutines concurrently; if one fails, cancel the rest and wait for them. Unlike :func:`asyncio.gather`, nothing is left running when this returns or raises, so a caller can safely close clients and release locks afterwards. :param coros: The coroutines. :returns: Their results, in order. :raises Exception: The first failure, unwrapped from the task group's exception group.