modal 0.67.2__py3-none-any.whl → 0.67.3__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.
- modal/_utils/async_utils.py +40 -0
- modal/client.pyi +2 -2
- {modal-0.67.2.dist-info → modal-0.67.3.dist-info}/METADATA +1 -1
- {modal-0.67.2.dist-info → modal-0.67.3.dist-info}/RECORD +9 -9
- modal_version/_version_generated.py +1 -1
- {modal-0.67.2.dist-info → modal-0.67.3.dist-info}/LICENSE +0 -0
- {modal-0.67.2.dist-info → modal-0.67.3.dist-info}/WHEEL +0 -0
- {modal-0.67.2.dist-info → modal-0.67.3.dist-info}/entry_points.txt +0 -0
- {modal-0.67.2.dist-info → modal-0.67.3.dist-info}/top_level.txt +0 -0
modal/_utils/async_utils.py
CHANGED
@@ -573,6 +573,46 @@ STOP_SENTINEL = StopSentinelType()
|
|
573
573
|
|
574
574
|
|
575
575
|
async def async_merge(*generators: AsyncGenerator[T, None]) -> AsyncGenerator[T, None]:
|
576
|
+
"""
|
577
|
+
Asynchronously merges multiple async generators into a single async generator.
|
578
|
+
|
579
|
+
This function takes multiple async generators and yields their values in the order
|
580
|
+
they are produced. If any generator raises an exception, the exception is propagated.
|
581
|
+
|
582
|
+
Args:
|
583
|
+
*generators: One or more async generators to be merged.
|
584
|
+
|
585
|
+
Yields:
|
586
|
+
The values produced by the input async generators.
|
587
|
+
|
588
|
+
Raises:
|
589
|
+
Exception: If any of the input generators raises an exception, it is propagated.
|
590
|
+
|
591
|
+
Usage:
|
592
|
+
```python
|
593
|
+
import asyncio
|
594
|
+
from modal._utils.async_utils import async_merge
|
595
|
+
|
596
|
+
async def gen1():
|
597
|
+
yield 1
|
598
|
+
yield 2
|
599
|
+
|
600
|
+
async def gen2():
|
601
|
+
yield "a"
|
602
|
+
yield "b"
|
603
|
+
|
604
|
+
async def example():
|
605
|
+
values = set()
|
606
|
+
async for value in async_merge(gen1(), gen2()):
|
607
|
+
values.add(value)
|
608
|
+
|
609
|
+
return values
|
610
|
+
|
611
|
+
# Output could be: {1, "a", 2, "b"} (order may vary)
|
612
|
+
values = asyncio.run(example())
|
613
|
+
assert values == {1, "a", 2, "b"}
|
614
|
+
```
|
615
|
+
"""
|
576
616
|
queue: asyncio.Queue[Union[ValueWrapper[T], ExceptionWrapper]] = asyncio.Queue(maxsize=len(generators) * 10)
|
577
617
|
|
578
618
|
async def producer(generator: AsyncGenerator[T, None]):
|
modal/client.pyi
CHANGED
@@ -31,7 +31,7 @@ class _Client:
|
|
31
31
|
server_url: str,
|
32
32
|
client_type: int,
|
33
33
|
credentials: typing.Optional[typing.Tuple[str, str]],
|
34
|
-
version: str = "0.67.
|
34
|
+
version: str = "0.67.3",
|
35
35
|
): ...
|
36
36
|
def is_closed(self) -> bool: ...
|
37
37
|
@property
|
@@ -90,7 +90,7 @@ class Client:
|
|
90
90
|
server_url: str,
|
91
91
|
client_type: int,
|
92
92
|
credentials: typing.Optional[typing.Tuple[str, str]],
|
93
|
-
version: str = "0.67.
|
93
|
+
version: str = "0.67.3",
|
94
94
|
): ...
|
95
95
|
def is_closed(self) -> bool: ...
|
96
96
|
@property
|
@@ -19,7 +19,7 @@ modal/app.py,sha256=IBOZQBq6T3l-uzNCM4eFWLkWfcc7r3kQExbKpcN4qgA,45486
|
|
19
19
|
modal/app.pyi,sha256=sX2BXX_178lp8O_GvwZqsxDdxQi1j3DjNfthMvlMlJU,25273
|
20
20
|
modal/call_graph.py,sha256=l-Wi6vM8aosCdHTWegcCyGeVJGFdZ_fzlCmbRVPBXFI,2593
|
21
21
|
modal/client.py,sha256=4SpWb4n0nolITR36kADZl1tYLOg6avukmzZU56UQjCo,16385
|
22
|
-
modal/client.pyi,sha256=
|
22
|
+
modal/client.pyi,sha256=0PBppPurMgmK5HpBDfhexTbqPoDXyEJX_UkXWDy6sbU,7370
|
23
23
|
modal/cloud_bucket_mount.py,sha256=eWQhCtMIczpokjfTZEgNBCGO_s5ft46PqTSLfKBykq4,5748
|
24
24
|
modal/cloud_bucket_mount.pyi,sha256=tTF7M4FR9bTA30cFkz8qq3ZTlFL19NHU_36e_5GgAGA,1424
|
25
25
|
modal/cls.py,sha256=W3fGE7wdShFwCeWS1oT0LX2_SHBCXy04DgfVt4ggXZA,24692
|
@@ -81,7 +81,7 @@ modal/_runtime/telemetry.py,sha256=3NbrfwYH6mvDckzdTppymmda2lQKX2oHGc2JwdFZdUc,5
|
|
81
81
|
modal/_runtime/user_code_imports.py,sha256=2COhqA77zwbP__-DWiDHEScHM-Go3CmI-AlKvT_oBOU,14545
|
82
82
|
modal/_utils/__init__.py,sha256=waLjl5c6IPDhSsdWAm9Bji4e2PVxamYABKAze6CHVXY,28
|
83
83
|
modal/_utils/app_utils.py,sha256=88BT4TPLWfYAQwKTHcyzNQRHg8n9B-QE2UyJs96iV-0,108
|
84
|
-
modal/_utils/async_utils.py,sha256=
|
84
|
+
modal/_utils/async_utils.py,sha256=LInaa9xOl256MwXPtFlgmgk9iS2OEJGF15BCyi_O0hE,24994
|
85
85
|
modal/_utils/blob_utils.py,sha256=pAY22w0oVc6ujGfI7La7HPUMOf42FehIapuhSDeeqEs,15835
|
86
86
|
modal/_utils/function_utils.py,sha256=28mxgg_-7JF1DDiNnp3iNVsFQkOzMFjORsetdvZZTHU,24475
|
87
87
|
modal/_utils/grpc_testing.py,sha256=LOzWygTdHINzV-o_Ajbl7sOFbUQFoonP0iKpsJjA_nc,8301
|
@@ -159,10 +159,10 @@ modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0y
|
|
159
159
|
modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
160
160
|
modal_version/__init__.py,sha256=3IY-AWLH55r35_mQXIaut0jrJvoPuf1NZJBQQfSbPuo,470
|
161
161
|
modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
|
162
|
-
modal_version/_version_generated.py,sha256=
|
163
|
-
modal-0.67.
|
164
|
-
modal-0.67.
|
165
|
-
modal-0.67.
|
166
|
-
modal-0.67.
|
167
|
-
modal-0.67.
|
168
|
-
modal-0.67.
|
162
|
+
modal_version/_version_generated.py,sha256=AQQM64k7Fenzkd69x9qYbCJfx0o_wLA1BLxhPAQpJkI,148
|
163
|
+
modal-0.67.3.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
|
164
|
+
modal-0.67.3.dist-info/METADATA,sha256=YcpX7WWSuUbGskc9jUXszuR-41gNcPlunyJFCqDYcJk,2328
|
165
|
+
modal-0.67.3.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
166
|
+
modal-0.67.3.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
|
167
|
+
modal-0.67.3.dist-info/top_level.txt,sha256=1nvYbOSIKcmU50fNrpnQnrrOpj269ei3LzgB6j9xGqg,64
|
168
|
+
modal-0.67.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|