esuls 0.1.9__py3-none-any.whl → 0.1.10__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
esuls/utils.py CHANGED
@@ -8,21 +8,16 @@ T = TypeVar("T")
8
8
 
9
9
 
10
10
  async def run_parallel(
11
- *coroutines: Awaitable[T],
12
- limit: int = 20
13
- ) -> List[T]:
14
- """Run parallel coroutines with semaphore limit"""
15
-
16
- semaphore = asyncio.Semaphore(limit)
17
-
18
- async def limited_coroutine(coro: Awaitable[T]) -> T:
19
- async with semaphore:
20
- return await coro
21
-
22
- tasks = [asyncio.create_task(limited_coroutine(coro)) for coro in coroutines]
23
-
24
- results = []
25
- for fut in asyncio.as_completed(tasks):
26
- results.append(await fut)
27
-
28
- return results
11
+ *coroutines: Awaitable[T],
12
+ limit: int = 20
13
+ ) -> List[T]:
14
+ """Run parallel coroutines with semaphore limit, preserving order"""
15
+
16
+ semaphore = asyncio.Semaphore(limit)
17
+
18
+ async def limited_coroutine(coro: Awaitable[T]) -> T:
19
+ async with semaphore:
20
+ return await coro
21
+
22
+ return await asyncio.gather(*[limited_coroutine(coro) for coro in coroutines])
23
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: esuls
3
- Version: 0.1.9
3
+ Version: 0.1.10
4
4
  Summary: Utility library for async database operations, HTTP requests, and parallel execution
5
5
  Author-email: IperGiove <ipergiove@gmail.com>
6
6
  License: MIT
@@ -0,0 +1,10 @@
1
+ esuls/__init__.py,sha256=dtZtmjZZ8jNspOd17BWsE9D9ofeg3vZF0vIpSgKaZqk,529
2
+ esuls/db_cli.py,sha256=F1XwkuzCc69ldnDv0-X4kl4VZ9zI6oJnqmQAOe2d8jE,17931
3
+ esuls/download_icon.py,sha256=w-bWbyPSbWvonzq43aDDtdxIvdKSa7OSyZ7LaN0uudg,3623
4
+ esuls/request_cli.py,sha256=Lfxl0fwSq0npQb_qzWj7tTeqXR6tuZKpOYkjtpWjxHQ,15084
5
+ esuls/utils.py,sha256=AAh9y8dSB1vGO8e7A10dpsYMPI5-e9gw-GPInYBoOvg,577
6
+ esuls-0.1.10.dist-info/licenses/LICENSE,sha256=AY0N01ARt0kbKB7CkByYLqqNQU-yalb-rpv-eXITEWA,1066
7
+ esuls-0.1.10.dist-info/METADATA,sha256=PCP8V4k_ZZLX4R2KtYFgbAxQsnC4v8wbfsJEDHtMyq0,6995
8
+ esuls-0.1.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
9
+ esuls-0.1.10.dist-info/top_level.txt,sha256=WWBDHRhQ0DQLBZKD7Un8uFN93GvVQnP4WvJKkvbACVA,6
10
+ esuls-0.1.10.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- esuls/__init__.py,sha256=dtZtmjZZ8jNspOd17BWsE9D9ofeg3vZF0vIpSgKaZqk,529
2
- esuls/db_cli.py,sha256=F1XwkuzCc69ldnDv0-X4kl4VZ9zI6oJnqmQAOe2d8jE,17931
3
- esuls/download_icon.py,sha256=w-bWbyPSbWvonzq43aDDtdxIvdKSa7OSyZ7LaN0uudg,3623
4
- esuls/request_cli.py,sha256=Lfxl0fwSq0npQb_qzWj7tTeqXR6tuZKpOYkjtpWjxHQ,15084
5
- esuls/utils.py,sha256=PjdxbcolJEiab9d5r6f8cLz2bE-S-vuCImcYUoMyTAQ,675
6
- esuls-0.1.9.dist-info/licenses/LICENSE,sha256=AY0N01ARt0kbKB7CkByYLqqNQU-yalb-rpv-eXITEWA,1066
7
- esuls-0.1.9.dist-info/METADATA,sha256=GV2GIJSCNBfBFGUt189fHJAWNCCOFMdJziWfZZm_ScA,6994
8
- esuls-0.1.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
9
- esuls-0.1.9.dist-info/top_level.txt,sha256=WWBDHRhQ0DQLBZKD7Un8uFN93GvVQnP4WvJKkvbACVA,6
10
- esuls-0.1.9.dist-info/RECORD,,
File without changes