modAL 1.4.3.dev15__py3-none-any.whl → 1.4.3.dev16__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.
@@ -94,6 +94,23 @@ class DaemonizedThreadPool:
94
94
  self.inputs.put((func, args))
95
95
 
96
96
 
97
+ def call_server(user_code_event_loop: UserCodeEventLoop):
98
+ async def run():
99
+ exit_event = asyncio.Event()
100
+
101
+ def _on_sigterm():
102
+ logger.info("server_received_sigterm")
103
+ exit_event.set()
104
+
105
+ user_code_event_loop.loop.add_signal_handler(signal.SIGTERM, _on_sigterm)
106
+ try:
107
+ await exit_event.wait()
108
+ finally:
109
+ user_code_event_loop.loop.remove_signal_handler(signal.SIGTERM)
110
+
111
+ user_code_event_loop.run(run())
112
+
113
+
97
114
  def call_function(
98
115
  user_code_event_loop: UserCodeEventLoop,
99
116
  container_io_manager: "modal._runtime.container_io_manager.ContainerIOManager",
@@ -385,7 +402,10 @@ def main(container_args: api_pb2.ContainerArguments, client: Client):
385
402
  )
386
403
 
387
404
  with service.execution_context(event_loop, container_io_manager) as finalized_functions:
388
- call_function(event_loop, container_io_manager, finalized_functions, batch_max_size, batch_wait_ms)
405
+ if function_def.is_server:
406
+ call_server(event_loop)
407
+ else:
408
+ call_function(event_loop, container_io_manager, finalized_functions, batch_max_size, batch_wait_ms)
389
409
 
390
410
 
391
411
  if __name__ == "__main__":
modal/client.pyi CHANGED
@@ -35,7 +35,7 @@ class _Client:
35
35
  server_url: str,
36
36
  client_type: int,
37
37
  credentials: typing.Optional[tuple[str, str]],
38
- version: str = "1.4.3.dev15",
38
+ version: str = "1.4.3.dev16",
39
39
  ):
40
40
  """mdmd:hidden
41
41
  The Modal client object is not intended to be instantiated directly by users.
@@ -175,7 +175,7 @@ class Client:
175
175
  server_url: str,
176
176
  client_type: int,
177
177
  credentials: typing.Optional[tuple[str, str]],
178
- version: str = "1.4.3.dev15",
178
+ version: str = "1.4.3.dev16",
179
179
  ):
180
180
  """mdmd:hidden
181
181
  The Modal client object is not intended to be instantiated directly by users.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: modal
3
- Version: 1.4.3.dev15
3
+ Version: 1.4.3.dev16
4
4
  Summary: Python client library for Modal
5
5
  Author-email: Modal Labs <support@modal.com>
6
6
  License-Expression: Apache-2.0
@@ -3,7 +3,7 @@ modal/__main__.py,sha256=CqxDUv1PzwZTi7sYOzxgSqfgEiDievza0pbrUCiyLTM,1591
3
3
  modal/_billing.py,sha256=ujSuVts2qikBRazQ9oTkUv5oqhBBQ10phW3mzQdyldw,3906
4
4
  modal/_clustered_functions.py,sha256=7amiOxErtlciWeBJBL2KvaxerUomJpTAJ3qElflFHQA,2884
5
5
  modal/_clustered_functions.pyi,sha256=JmYwAGOLEnD5AF-gYF9O5tu-SgGjeoJz-X1j48b1Ijg,1157
6
- modal/_container_entrypoint.py,sha256=cD5XFxcqeja2dH1kRDlAWsCNyeYF5aq2CyekZ3CnTH4,20405
6
+ modal/_container_entrypoint.py,sha256=_dyBqh_3KFn1M8S2Z4upvHT1rAYvxggz8-uCb3N6w5Q,20994
7
7
  modal/_environments.py,sha256=vrn4f0DEOBwQzqeb4ZSzb3_rcI5S92onJeVG7RepAG0,17631
8
8
  modal/_functions.py,sha256=J9n6wC3LiW_S5isd4FZsErWUs1wRbk-5G6WMpyWOym4,89044
9
9
  modal/_grpc_client.py,sha256=G8gWQXChtsuRgyXK9kcPiPNYXOYbl_m9Bz2AVBJb-zs,6924
@@ -27,7 +27,7 @@ modal/app.pyi,sha256=-9667eLtUgoinLTRrJ-Z3SOgMR0S89Qw_vpwEZfp2Pk,53910
27
27
  modal/billing.py,sha256=B2zXa7KeMnpqi2AQINycEk-KSXVYaLTTTAQTtuf2Gfs,257
28
28
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
29
29
  modal/client.py,sha256=jjT4eLFHGcvIF6Xw4kPptIx-VmExtphRN8XJ1JA7fWI,15502
30
- modal/client.pyi,sha256=6ZZE2pg7Qg9lcwhtafb1phrKYRy26yHYNhdF065sQQU,15703
30
+ modal/client.pyi,sha256=S8QsFNX5vRJ4FwYGCMVkllhQZteyK_5ccZDbd57zmtk,15703
31
31
  modal/cloud_bucket_mount.py,sha256=KkaJVy5vpO_u2NtDYtv1JM-M3y4J0UtWBapTDKpQRcA,6034
32
32
  modal/cloud_bucket_mount.pyi,sha256=mGDeEd1XvxGpCE6O5jRBSfIvMXvZ5AtIybea5k-0w9w,7560
33
33
  modal/cls.py,sha256=Yrl5b_tQhZMhc5avInM-i5UlGuqeog6Gs4rX2d9lLjI,40390
@@ -177,7 +177,7 @@ modal/experimental/__init__.py,sha256=Wb1YoAKAnNxH_0c2wA0T12I7bSu9PSO2nS_LuLska7
177
177
  modal/experimental/flash.py,sha256=ATGhVO8AleJ-TOe2PGolI5T7zfCEtj0kl_ivMPp7Rqg,33362
178
178
  modal/experimental/flash.pyi,sha256=R4h2nQl7-oiwqq_twCp0YqID_LnPjPGqxywXvxbiLIk,17011
179
179
  modal/experimental/ipython.py,sha256=TrCfmol9LGsRZMeDoeMPx3Hv3BFqQhYnmD_iH0pqdhk,2904
180
- modal-1.4.3.dev15.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
180
+ modal-1.4.3.dev16.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
181
181
  modal_docs/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
182
182
  modal_docs/gen_cli_docs.py,sha256=bfUSLscHfoQoKkKjIqJvQMe3fURzqcQK7gF1h9WQLtM,3742
183
183
  modal_docs/gen_cli_docs_main.py,sha256=UPGr7O1DYTIRLwfINe2rbdh89J3cPVTU1OWL-SjxnOQ,198
@@ -199,10 +199,10 @@ modal_proto/task_command_router_pb2.py,sha256=6TY5umHeqYdFNuRaOoZP2YfUbtCxRHqyi2
199
199
  modal_proto/task_command_router_pb2.pyi,sha256=PYljoZVw16_d4Hn-9cD6SDssmYsvVqx_HOgEEUGYBLk,31452
200
200
  modal_proto/task_command_router_pb2_grpc.py,sha256=XVmcdxLnK_IY3trlF6nLmzFhqSG-bbYNABC7xIs6fT8,28732
201
201
  modal_proto/task_command_router_pb2_grpc.pyi,sha256=og_J8CxYeAV0ikpHXZMvr_uC15UD3I3fgyyAO2pGm1E,8981
202
- modal_version/__init__.py,sha256=TCBpwH-Sr7Wo_6LDhD02J-aNiYZEx390JdX8Yt3iHGU,121
202
+ modal_version/__init__.py,sha256=ij91HAnOI88iaEFbCJlrQJDGXTkKwhM14eTnrWhz3-Q,121
203
203
  modal_version/__main__.py,sha256=nLUbubxKx7GXNzJIkTB7M7_u8080LyLM0IS0rzFkC_c,119
204
- modal-1.4.3.dev15.dist-info/METADATA,sha256=_JOlYohZMnu95Wazf2f6f1VK9XDzgvJLvjT84i9zNpQ,2339
205
- modal-1.4.3.dev15.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
206
- modal-1.4.3.dev15.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
207
- modal-1.4.3.dev15.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
208
- modal-1.4.3.dev15.dist-info/RECORD,,
204
+ modal-1.4.3.dev16.dist-info/METADATA,sha256=-JxeVHWvx7NNWyzOEmM-uHQ1NtqfL2Ld3bQolC6r6bk,2339
205
+ modal-1.4.3.dev16.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
206
+ modal-1.4.3.dev16.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
207
+ modal-1.4.3.dev16.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
208
+ modal-1.4.3.dev16.dist-info/RECORD,,
modal_version/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # Copyright Modal Labs 2026
2
2
  """Supplies the current version of the modal client library."""
3
3
 
4
- __version__ = "1.4.3.dev15"
4
+ __version__ = "1.4.3.dev16"