modal 1.0.6.dev58__py3-none-any.whl → 1.2.3.dev7__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.
Potentially problematic release.
This version of modal might be problematic. Click here for more details.
- modal/__main__.py +3 -4
- modal/_billing.py +80 -0
- modal/_clustered_functions.py +7 -3
- modal/_clustered_functions.pyi +4 -2
- modal/_container_entrypoint.py +41 -49
- modal/_functions.py +424 -195
- modal/_grpc_client.py +171 -0
- modal/_load_context.py +105 -0
- modal/_object.py +68 -20
- modal/_output.py +58 -45
- modal/_partial_function.py +36 -11
- modal/_pty.py +7 -3
- modal/_resolver.py +21 -35
- modal/_runtime/asgi.py +4 -3
- modal/_runtime/container_io_manager.py +301 -186
- modal/_runtime/container_io_manager.pyi +70 -61
- modal/_runtime/execution_context.py +18 -2
- modal/_runtime/execution_context.pyi +4 -1
- modal/_runtime/gpu_memory_snapshot.py +170 -63
- modal/_runtime/user_code_imports.py +28 -58
- modal/_serialization.py +57 -1
- modal/_utils/async_utils.py +33 -12
- modal/_utils/auth_token_manager.py +2 -5
- modal/_utils/blob_utils.py +110 -53
- modal/_utils/function_utils.py +49 -42
- modal/_utils/grpc_utils.py +80 -50
- modal/_utils/mount_utils.py +26 -1
- modal/_utils/name_utils.py +17 -3
- modal/_utils/task_command_router_client.py +536 -0
- modal/_utils/time_utils.py +34 -6
- modal/app.py +219 -83
- modal/app.pyi +229 -56
- modal/billing.py +5 -0
- modal/{requirements → builder}/2025.06.txt +1 -0
- modal/{requirements → builder}/PREVIEW.txt +1 -0
- modal/cli/_download.py +19 -3
- modal/cli/_traceback.py +3 -2
- modal/cli/app.py +4 -4
- modal/cli/cluster.py +15 -7
- modal/cli/config.py +5 -3
- modal/cli/container.py +7 -6
- modal/cli/dict.py +22 -16
- modal/cli/entry_point.py +12 -5
- modal/cli/environment.py +5 -4
- modal/cli/import_refs.py +3 -3
- modal/cli/launch.py +102 -5
- modal/cli/network_file_system.py +9 -13
- modal/cli/profile.py +3 -2
- modal/cli/programs/launch_instance_ssh.py +94 -0
- modal/cli/programs/run_jupyter.py +1 -1
- modal/cli/programs/run_marimo.py +95 -0
- modal/cli/programs/vscode.py +1 -1
- modal/cli/queues.py +57 -26
- modal/cli/run.py +58 -16
- modal/cli/secret.py +48 -22
- modal/cli/utils.py +3 -4
- modal/cli/volume.py +28 -25
- modal/client.py +13 -116
- modal/client.pyi +9 -91
- modal/cloud_bucket_mount.py +5 -3
- modal/cloud_bucket_mount.pyi +5 -1
- modal/cls.py +130 -102
- modal/cls.pyi +45 -85
- modal/config.py +29 -10
- modal/container_process.py +291 -13
- modal/container_process.pyi +95 -32
- modal/dict.py +282 -63
- modal/dict.pyi +423 -73
- modal/environments.py +15 -27
- modal/environments.pyi +5 -15
- modal/exception.py +8 -0
- modal/experimental/__init__.py +143 -38
- modal/experimental/flash.py +247 -78
- modal/experimental/flash.pyi +137 -9
- modal/file_io.py +14 -28
- modal/file_io.pyi +2 -2
- modal/file_pattern_matcher.py +25 -16
- modal/functions.pyi +134 -61
- modal/image.py +255 -86
- modal/image.pyi +300 -62
- modal/io_streams.py +436 -126
- modal/io_streams.pyi +236 -171
- modal/mount.py +62 -157
- modal/mount.pyi +45 -172
- modal/network_file_system.py +30 -53
- modal/network_file_system.pyi +16 -76
- modal/object.pyi +42 -8
- modal/parallel_map.py +821 -113
- modal/parallel_map.pyi +134 -0
- modal/partial_function.pyi +4 -1
- modal/proxy.py +16 -7
- modal/proxy.pyi +10 -2
- modal/queue.py +263 -61
- modal/queue.pyi +409 -66
- modal/runner.py +112 -92
- modal/runner.pyi +45 -27
- modal/sandbox.py +451 -124
- modal/sandbox.pyi +513 -67
- modal/secret.py +291 -67
- modal/secret.pyi +425 -19
- modal/serving.py +7 -11
- modal/serving.pyi +7 -8
- modal/snapshot.py +11 -8
- modal/token_flow.py +4 -4
- modal/volume.py +344 -98
- modal/volume.pyi +464 -68
- {modal-1.0.6.dev58.dist-info → modal-1.2.3.dev7.dist-info}/METADATA +9 -8
- modal-1.2.3.dev7.dist-info/RECORD +195 -0
- modal_docs/mdmd/mdmd.py +11 -1
- modal_proto/api.proto +399 -67
- modal_proto/api_grpc.py +241 -1
- modal_proto/api_pb2.py +1395 -1000
- modal_proto/api_pb2.pyi +1239 -79
- modal_proto/api_pb2_grpc.py +499 -4
- modal_proto/api_pb2_grpc.pyi +162 -14
- modal_proto/modal_api_grpc.py +175 -160
- modal_proto/sandbox_router.proto +145 -0
- modal_proto/sandbox_router_grpc.py +105 -0
- modal_proto/sandbox_router_pb2.py +149 -0
- modal_proto/sandbox_router_pb2.pyi +333 -0
- modal_proto/sandbox_router_pb2_grpc.py +203 -0
- modal_proto/sandbox_router_pb2_grpc.pyi +75 -0
- modal_proto/task_command_router.proto +144 -0
- modal_proto/task_command_router_grpc.py +105 -0
- modal_proto/task_command_router_pb2.py +149 -0
- modal_proto/task_command_router_pb2.pyi +333 -0
- modal_proto/task_command_router_pb2_grpc.py +203 -0
- modal_proto/task_command_router_pb2_grpc.pyi +75 -0
- modal_version/__init__.py +1 -1
- modal-1.0.6.dev58.dist-info/RECORD +0 -183
- modal_proto/modal_options_grpc.py +0 -3
- modal_proto/options.proto +0 -19
- modal_proto/options_grpc.py +0 -3
- modal_proto/options_pb2.py +0 -35
- modal_proto/options_pb2.pyi +0 -20
- modal_proto/options_pb2_grpc.py +0 -4
- modal_proto/options_pb2_grpc.pyi +0 -7
- /modal/{requirements → builder}/2023.12.312.txt +0 -0
- /modal/{requirements → builder}/2023.12.txt +0 -0
- /modal/{requirements → builder}/2024.04.txt +0 -0
- /modal/{requirements → builder}/2024.10.txt +0 -0
- /modal/{requirements → builder}/README.md +0 -0
- /modal/{requirements → builder}/base-images.json +0 -0
- {modal-1.0.6.dev58.dist-info → modal-1.2.3.dev7.dist-info}/WHEEL +0 -0
- {modal-1.0.6.dev58.dist-info → modal-1.2.3.dev7.dist-info}/entry_points.txt +0 -0
- {modal-1.0.6.dev58.dist-info → modal-1.2.3.dev7.dist-info}/licenses/LICENSE +0 -0
- {modal-1.0.6.dev58.dist-info → modal-1.2.3.dev7.dist-info}/top_level.txt +0 -0
modal/queue.pyi
CHANGED
|
@@ -1,11 +1,356 @@
|
|
|
1
1
|
import collections.abc
|
|
2
|
+
import datetime
|
|
3
|
+
import google.protobuf.message
|
|
2
4
|
import modal._object
|
|
3
5
|
import modal.client
|
|
4
6
|
import modal.object
|
|
7
|
+
import modal_proto.api_pb2
|
|
8
|
+
import synchronicity
|
|
5
9
|
import synchronicity.combined_types
|
|
6
10
|
import typing
|
|
7
11
|
import typing_extensions
|
|
8
12
|
|
|
13
|
+
class QueueInfo:
|
|
14
|
+
"""Information about the Queue object."""
|
|
15
|
+
|
|
16
|
+
name: typing.Optional[str]
|
|
17
|
+
created_at: datetime.datetime
|
|
18
|
+
created_by: typing.Optional[str]
|
|
19
|
+
|
|
20
|
+
def __init__(
|
|
21
|
+
self, name: typing.Optional[str], created_at: datetime.datetime, created_by: typing.Optional[str]
|
|
22
|
+
) -> None:
|
|
23
|
+
"""Initialize self. See help(type(self)) for accurate signature."""
|
|
24
|
+
...
|
|
25
|
+
|
|
26
|
+
def __repr__(self):
|
|
27
|
+
"""Return repr(self)."""
|
|
28
|
+
...
|
|
29
|
+
|
|
30
|
+
def __eq__(self, other):
|
|
31
|
+
"""Return self==value."""
|
|
32
|
+
...
|
|
33
|
+
|
|
34
|
+
class _QueueManager:
|
|
35
|
+
"""Namespace with methods for managing named Queue objects."""
|
|
36
|
+
@staticmethod
|
|
37
|
+
async def create(
|
|
38
|
+
name: str,
|
|
39
|
+
*,
|
|
40
|
+
allow_existing: bool = False,
|
|
41
|
+
environment_name: typing.Optional[str] = None,
|
|
42
|
+
client: typing.Optional[modal.client._Client] = None,
|
|
43
|
+
) -> None:
|
|
44
|
+
"""Create a new Queue object.
|
|
45
|
+
|
|
46
|
+
**Examples:**
|
|
47
|
+
|
|
48
|
+
```python notest
|
|
49
|
+
modal.Queue.objects.create("my-queue")
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Queues will be created in the active environment, or another one can be specified:
|
|
53
|
+
|
|
54
|
+
```python notest
|
|
55
|
+
modal.Queue.objects.create("my-queue", environment_name="dev")
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
By default, an error will be raised if the Queue already exists, but passing
|
|
59
|
+
`allow_existing=True` will make the creation attempt a no-op in this case.
|
|
60
|
+
|
|
61
|
+
```python notest
|
|
62
|
+
modal.Queue.objects.create("my-queue", allow_existing=True)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Note that this method does not return a local instance of the Queue. You can use
|
|
66
|
+
`modal.Queue.from_name` to perform a lookup after creation.
|
|
67
|
+
|
|
68
|
+
Added in v1.1.2.
|
|
69
|
+
"""
|
|
70
|
+
...
|
|
71
|
+
|
|
72
|
+
@staticmethod
|
|
73
|
+
async def list(
|
|
74
|
+
*,
|
|
75
|
+
max_objects: typing.Optional[int] = None,
|
|
76
|
+
created_before: typing.Union[datetime.datetime, str, None] = None,
|
|
77
|
+
environment_name: str = "",
|
|
78
|
+
client: typing.Optional[modal.client._Client] = None,
|
|
79
|
+
) -> list[_Queue]:
|
|
80
|
+
"""Return a list of hydrated Queue objects.
|
|
81
|
+
|
|
82
|
+
**Examples:**
|
|
83
|
+
|
|
84
|
+
```python
|
|
85
|
+
queues = modal.Queue.objects.list()
|
|
86
|
+
print([q.name for q in queues])
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Queues will be retreived from the active environment, or another one can be specified:
|
|
90
|
+
|
|
91
|
+
```python notest
|
|
92
|
+
dev_queues = modal.Queue.objects.list(environment_name="dev")
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
By default, all named Queues are returned, newest to oldest. It's also possible to limit the
|
|
96
|
+
number of results and to filter by creation date:
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
queues = modal.Queue.objects.list(max_objects=10, created_before="2025-01-01")
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Added in v1.1.2.
|
|
103
|
+
"""
|
|
104
|
+
...
|
|
105
|
+
|
|
106
|
+
@staticmethod
|
|
107
|
+
async def delete(
|
|
108
|
+
name: str,
|
|
109
|
+
*,
|
|
110
|
+
allow_missing: bool = False,
|
|
111
|
+
environment_name: typing.Optional[str] = None,
|
|
112
|
+
client: typing.Optional[modal.client._Client] = None,
|
|
113
|
+
):
|
|
114
|
+
"""Delete a named Queue.
|
|
115
|
+
|
|
116
|
+
Warning: This deletes an *entire Queue*, not just a specific entry or partition.
|
|
117
|
+
Deletion is irreversible and will affect any Apps currently using the Queue.
|
|
118
|
+
|
|
119
|
+
**Examples:**
|
|
120
|
+
|
|
121
|
+
```python notest
|
|
122
|
+
await modal.Queue.objects.delete("my-queue")
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Queues will be deleted from the active environment, or another one can be specified:
|
|
126
|
+
|
|
127
|
+
```python notest
|
|
128
|
+
await modal.Queue.objects.delete("my-queue", environment_name="dev")
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Added in v1.1.2.
|
|
132
|
+
"""
|
|
133
|
+
...
|
|
134
|
+
|
|
135
|
+
class QueueManager:
|
|
136
|
+
"""Namespace with methods for managing named Queue objects."""
|
|
137
|
+
def __init__(self, /, *args, **kwargs):
|
|
138
|
+
"""Initialize self. See help(type(self)) for accurate signature."""
|
|
139
|
+
...
|
|
140
|
+
|
|
141
|
+
class __create_spec(typing_extensions.Protocol):
|
|
142
|
+
def __call__(
|
|
143
|
+
self,
|
|
144
|
+
/,
|
|
145
|
+
name: str,
|
|
146
|
+
*,
|
|
147
|
+
allow_existing: bool = False,
|
|
148
|
+
environment_name: typing.Optional[str] = None,
|
|
149
|
+
client: typing.Optional[modal.client.Client] = None,
|
|
150
|
+
) -> None:
|
|
151
|
+
"""Create a new Queue object.
|
|
152
|
+
|
|
153
|
+
**Examples:**
|
|
154
|
+
|
|
155
|
+
```python notest
|
|
156
|
+
modal.Queue.objects.create("my-queue")
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Queues will be created in the active environment, or another one can be specified:
|
|
160
|
+
|
|
161
|
+
```python notest
|
|
162
|
+
modal.Queue.objects.create("my-queue", environment_name="dev")
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
By default, an error will be raised if the Queue already exists, but passing
|
|
166
|
+
`allow_existing=True` will make the creation attempt a no-op in this case.
|
|
167
|
+
|
|
168
|
+
```python notest
|
|
169
|
+
modal.Queue.objects.create("my-queue", allow_existing=True)
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Note that this method does not return a local instance of the Queue. You can use
|
|
173
|
+
`modal.Queue.from_name` to perform a lookup after creation.
|
|
174
|
+
|
|
175
|
+
Added in v1.1.2.
|
|
176
|
+
"""
|
|
177
|
+
...
|
|
178
|
+
|
|
179
|
+
async def aio(
|
|
180
|
+
self,
|
|
181
|
+
/,
|
|
182
|
+
name: str,
|
|
183
|
+
*,
|
|
184
|
+
allow_existing: bool = False,
|
|
185
|
+
environment_name: typing.Optional[str] = None,
|
|
186
|
+
client: typing.Optional[modal.client.Client] = None,
|
|
187
|
+
) -> None:
|
|
188
|
+
"""Create a new Queue object.
|
|
189
|
+
|
|
190
|
+
**Examples:**
|
|
191
|
+
|
|
192
|
+
```python notest
|
|
193
|
+
modal.Queue.objects.create("my-queue")
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Queues will be created in the active environment, or another one can be specified:
|
|
197
|
+
|
|
198
|
+
```python notest
|
|
199
|
+
modal.Queue.objects.create("my-queue", environment_name="dev")
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
By default, an error will be raised if the Queue already exists, but passing
|
|
203
|
+
`allow_existing=True` will make the creation attempt a no-op in this case.
|
|
204
|
+
|
|
205
|
+
```python notest
|
|
206
|
+
modal.Queue.objects.create("my-queue", allow_existing=True)
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Note that this method does not return a local instance of the Queue. You can use
|
|
210
|
+
`modal.Queue.from_name` to perform a lookup after creation.
|
|
211
|
+
|
|
212
|
+
Added in v1.1.2.
|
|
213
|
+
"""
|
|
214
|
+
...
|
|
215
|
+
|
|
216
|
+
create: __create_spec
|
|
217
|
+
|
|
218
|
+
class __list_spec(typing_extensions.Protocol):
|
|
219
|
+
def __call__(
|
|
220
|
+
self,
|
|
221
|
+
/,
|
|
222
|
+
*,
|
|
223
|
+
max_objects: typing.Optional[int] = None,
|
|
224
|
+
created_before: typing.Union[datetime.datetime, str, None] = None,
|
|
225
|
+
environment_name: str = "",
|
|
226
|
+
client: typing.Optional[modal.client.Client] = None,
|
|
227
|
+
) -> list[Queue]:
|
|
228
|
+
"""Return a list of hydrated Queue objects.
|
|
229
|
+
|
|
230
|
+
**Examples:**
|
|
231
|
+
|
|
232
|
+
```python
|
|
233
|
+
queues = modal.Queue.objects.list()
|
|
234
|
+
print([q.name for q in queues])
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Queues will be retreived from the active environment, or another one can be specified:
|
|
238
|
+
|
|
239
|
+
```python notest
|
|
240
|
+
dev_queues = modal.Queue.objects.list(environment_name="dev")
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
By default, all named Queues are returned, newest to oldest. It's also possible to limit the
|
|
244
|
+
number of results and to filter by creation date:
|
|
245
|
+
|
|
246
|
+
```python
|
|
247
|
+
queues = modal.Queue.objects.list(max_objects=10, created_before="2025-01-01")
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
Added in v1.1.2.
|
|
251
|
+
"""
|
|
252
|
+
...
|
|
253
|
+
|
|
254
|
+
async def aio(
|
|
255
|
+
self,
|
|
256
|
+
/,
|
|
257
|
+
*,
|
|
258
|
+
max_objects: typing.Optional[int] = None,
|
|
259
|
+
created_before: typing.Union[datetime.datetime, str, None] = None,
|
|
260
|
+
environment_name: str = "",
|
|
261
|
+
client: typing.Optional[modal.client.Client] = None,
|
|
262
|
+
) -> list[Queue]:
|
|
263
|
+
"""Return a list of hydrated Queue objects.
|
|
264
|
+
|
|
265
|
+
**Examples:**
|
|
266
|
+
|
|
267
|
+
```python
|
|
268
|
+
queues = modal.Queue.objects.list()
|
|
269
|
+
print([q.name for q in queues])
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
Queues will be retreived from the active environment, or another one can be specified:
|
|
273
|
+
|
|
274
|
+
```python notest
|
|
275
|
+
dev_queues = modal.Queue.objects.list(environment_name="dev")
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
By default, all named Queues are returned, newest to oldest. It's also possible to limit the
|
|
279
|
+
number of results and to filter by creation date:
|
|
280
|
+
|
|
281
|
+
```python
|
|
282
|
+
queues = modal.Queue.objects.list(max_objects=10, created_before="2025-01-01")
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
Added in v1.1.2.
|
|
286
|
+
"""
|
|
287
|
+
...
|
|
288
|
+
|
|
289
|
+
list: __list_spec
|
|
290
|
+
|
|
291
|
+
class __delete_spec(typing_extensions.Protocol):
|
|
292
|
+
def __call__(
|
|
293
|
+
self,
|
|
294
|
+
/,
|
|
295
|
+
name: str,
|
|
296
|
+
*,
|
|
297
|
+
allow_missing: bool = False,
|
|
298
|
+
environment_name: typing.Optional[str] = None,
|
|
299
|
+
client: typing.Optional[modal.client.Client] = None,
|
|
300
|
+
):
|
|
301
|
+
"""Delete a named Queue.
|
|
302
|
+
|
|
303
|
+
Warning: This deletes an *entire Queue*, not just a specific entry or partition.
|
|
304
|
+
Deletion is irreversible and will affect any Apps currently using the Queue.
|
|
305
|
+
|
|
306
|
+
**Examples:**
|
|
307
|
+
|
|
308
|
+
```python notest
|
|
309
|
+
await modal.Queue.objects.delete("my-queue")
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
Queues will be deleted from the active environment, or another one can be specified:
|
|
313
|
+
|
|
314
|
+
```python notest
|
|
315
|
+
await modal.Queue.objects.delete("my-queue", environment_name="dev")
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
Added in v1.1.2.
|
|
319
|
+
"""
|
|
320
|
+
...
|
|
321
|
+
|
|
322
|
+
async def aio(
|
|
323
|
+
self,
|
|
324
|
+
/,
|
|
325
|
+
name: str,
|
|
326
|
+
*,
|
|
327
|
+
allow_missing: bool = False,
|
|
328
|
+
environment_name: typing.Optional[str] = None,
|
|
329
|
+
client: typing.Optional[modal.client.Client] = None,
|
|
330
|
+
):
|
|
331
|
+
"""Delete a named Queue.
|
|
332
|
+
|
|
333
|
+
Warning: This deletes an *entire Queue*, not just a specific entry or partition.
|
|
334
|
+
Deletion is irreversible and will affect any Apps currently using the Queue.
|
|
335
|
+
|
|
336
|
+
**Examples:**
|
|
337
|
+
|
|
338
|
+
```python notest
|
|
339
|
+
await modal.Queue.objects.delete("my-queue")
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
Queues will be deleted from the active environment, or another one can be specified:
|
|
343
|
+
|
|
344
|
+
```python notest
|
|
345
|
+
await modal.Queue.objects.delete("my-queue", environment_name="dev")
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
Added in v1.1.2.
|
|
349
|
+
"""
|
|
350
|
+
...
|
|
351
|
+
|
|
352
|
+
delete: __delete_spec
|
|
353
|
+
|
|
9
354
|
class _Queue(modal._object._Object):
|
|
10
355
|
"""Distributed, FIFO queue for data flow in Modal apps.
|
|
11
356
|
|
|
@@ -78,10 +423,19 @@ class _Queue(modal._object._Object):
|
|
|
78
423
|
|
|
79
424
|
Partition keys must be non-empty and must not exceed 64 bytes.
|
|
80
425
|
"""
|
|
426
|
+
|
|
427
|
+
_metadata: typing.Optional[modal_proto.api_pb2.QueueMetadata]
|
|
428
|
+
|
|
81
429
|
def __init__(self):
|
|
82
430
|
"""mdmd:hidden"""
|
|
83
431
|
...
|
|
84
432
|
|
|
433
|
+
@synchronicity.classproperty
|
|
434
|
+
def objects(cls) -> _QueueManager: ...
|
|
435
|
+
@property
|
|
436
|
+
def name(self) -> typing.Optional[str]: ...
|
|
437
|
+
def _hydrate_metadata(self, metadata: typing.Optional[google.protobuf.message.Message]): ...
|
|
438
|
+
def _get_metadata(self) -> modal_proto.api_pb2.QueueMetadata: ...
|
|
85
439
|
@staticmethod
|
|
86
440
|
def validate_partition_key(partition: typing.Optional[str]) -> bytes: ...
|
|
87
441
|
@classmethod
|
|
@@ -110,7 +464,12 @@ class _Queue(modal._object._Object):
|
|
|
110
464
|
|
|
111
465
|
@staticmethod
|
|
112
466
|
def from_name(
|
|
113
|
-
name: str,
|
|
467
|
+
name: str,
|
|
468
|
+
*,
|
|
469
|
+
namespace=None,
|
|
470
|
+
environment_name: typing.Optional[str] = None,
|
|
471
|
+
create_if_missing: bool = False,
|
|
472
|
+
client: typing.Optional[modal.client._Client] = None,
|
|
114
473
|
) -> _Queue:
|
|
115
474
|
"""Reference a named Queue, creating if necessary.
|
|
116
475
|
|
|
@@ -126,35 +485,26 @@ class _Queue(modal._object._Object):
|
|
|
126
485
|
...
|
|
127
486
|
|
|
128
487
|
@staticmethod
|
|
129
|
-
async def
|
|
488
|
+
async def delete(
|
|
130
489
|
name: str,
|
|
131
|
-
|
|
490
|
+
*,
|
|
132
491
|
client: typing.Optional[modal.client._Client] = None,
|
|
133
492
|
environment_name: typing.Optional[str] = None,
|
|
134
|
-
|
|
135
|
-
) -> _Queue:
|
|
493
|
+
):
|
|
136
494
|
"""mdmd:hidden
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
DEPRECATED: This method is deprecated in favor of `modal.Queue.from_name`.
|
|
495
|
+
Delete a named Queue.
|
|
140
496
|
|
|
141
|
-
|
|
142
|
-
|
|
497
|
+
Warning: This deletes an *entire Queue*, not just a specific entry or partition.
|
|
498
|
+
Deletion is irreversible and will affect any Apps currently using the Queue.
|
|
143
499
|
|
|
144
|
-
|
|
145
|
-
q = modal.Queue.lookup("my-queue")
|
|
146
|
-
q.put(123)
|
|
147
|
-
```
|
|
500
|
+
DEPRECATED: This method is deprecated; we recommend using `modal.Queue.objects.delete` instead.
|
|
148
501
|
"""
|
|
149
502
|
...
|
|
150
503
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
client: typing.Optional[modal.client._Client] = None,
|
|
156
|
-
environment_name: typing.Optional[str] = None,
|
|
157
|
-
): ...
|
|
504
|
+
async def info(self) -> QueueInfo:
|
|
505
|
+
"""Return information about the Queue object."""
|
|
506
|
+
...
|
|
507
|
+
|
|
158
508
|
async def _get_nonblocking(self, partition: typing.Optional[str], n_values: int) -> list[typing.Any]: ...
|
|
159
509
|
async def _get_blocking(
|
|
160
510
|
self, partition: typing.Optional[str], timeout: typing.Optional[float], n_values: int
|
|
@@ -335,10 +685,19 @@ class Queue(modal.object.Object):
|
|
|
335
685
|
|
|
336
686
|
Partition keys must be non-empty and must not exceed 64 bytes.
|
|
337
687
|
"""
|
|
688
|
+
|
|
689
|
+
_metadata: typing.Optional[modal_proto.api_pb2.QueueMetadata]
|
|
690
|
+
|
|
338
691
|
def __init__(self):
|
|
339
692
|
"""mdmd:hidden"""
|
|
340
693
|
...
|
|
341
694
|
|
|
695
|
+
@synchronicity.classproperty
|
|
696
|
+
def objects(cls) -> QueueManager: ...
|
|
697
|
+
@property
|
|
698
|
+
def name(self) -> typing.Optional[str]: ...
|
|
699
|
+
def _hydrate_metadata(self, metadata: typing.Optional[google.protobuf.message.Message]): ...
|
|
700
|
+
def _get_metadata(self) -> modal_proto.api_pb2.QueueMetadata: ...
|
|
342
701
|
@staticmethod
|
|
343
702
|
def validate_partition_key(partition: typing.Optional[str]) -> bytes: ...
|
|
344
703
|
@classmethod
|
|
@@ -367,7 +726,12 @@ class Queue(modal.object.Object):
|
|
|
367
726
|
|
|
368
727
|
@staticmethod
|
|
369
728
|
def from_name(
|
|
370
|
-
name: str,
|
|
729
|
+
name: str,
|
|
730
|
+
*,
|
|
731
|
+
namespace=None,
|
|
732
|
+
environment_name: typing.Optional[str] = None,
|
|
733
|
+
create_if_missing: bool = False,
|
|
734
|
+
client: typing.Optional[modal.client.Client] = None,
|
|
371
735
|
) -> Queue:
|
|
372
736
|
"""Reference a named Queue, creating if necessary.
|
|
373
737
|
|
|
@@ -382,28 +746,22 @@ class Queue(modal.object.Object):
|
|
|
382
746
|
"""
|
|
383
747
|
...
|
|
384
748
|
|
|
385
|
-
class
|
|
749
|
+
class __delete_spec(typing_extensions.Protocol):
|
|
386
750
|
def __call__(
|
|
387
751
|
self,
|
|
388
752
|
/,
|
|
389
753
|
name: str,
|
|
390
|
-
|
|
754
|
+
*,
|
|
391
755
|
client: typing.Optional[modal.client.Client] = None,
|
|
392
756
|
environment_name: typing.Optional[str] = None,
|
|
393
|
-
|
|
394
|
-
) -> Queue:
|
|
757
|
+
):
|
|
395
758
|
"""mdmd:hidden
|
|
396
|
-
|
|
759
|
+
Delete a named Queue.
|
|
397
760
|
|
|
398
|
-
|
|
761
|
+
Warning: This deletes an *entire Queue*, not just a specific entry or partition.
|
|
762
|
+
Deletion is irreversible and will affect any Apps currently using the Queue.
|
|
399
763
|
|
|
400
|
-
|
|
401
|
-
that will hydrate the local object with metadata from Modal servers.
|
|
402
|
-
|
|
403
|
-
```python notest
|
|
404
|
-
q = modal.Queue.lookup("my-queue")
|
|
405
|
-
q.put(123)
|
|
406
|
-
```
|
|
764
|
+
DEPRECATED: This method is deprecated; we recommend using `modal.Queue.objects.delete` instead.
|
|
407
765
|
"""
|
|
408
766
|
...
|
|
409
767
|
|
|
@@ -411,47 +769,32 @@ class Queue(modal.object.Object):
|
|
|
411
769
|
self,
|
|
412
770
|
/,
|
|
413
771
|
name: str,
|
|
414
|
-
|
|
772
|
+
*,
|
|
415
773
|
client: typing.Optional[modal.client.Client] = None,
|
|
416
774
|
environment_name: typing.Optional[str] = None,
|
|
417
|
-
|
|
418
|
-
) -> Queue:
|
|
775
|
+
):
|
|
419
776
|
"""mdmd:hidden
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
DEPRECATED: This method is deprecated in favor of `modal.Queue.from_name`.
|
|
777
|
+
Delete a named Queue.
|
|
423
778
|
|
|
424
|
-
|
|
425
|
-
|
|
779
|
+
Warning: This deletes an *entire Queue*, not just a specific entry or partition.
|
|
780
|
+
Deletion is irreversible and will affect any Apps currently using the Queue.
|
|
426
781
|
|
|
427
|
-
|
|
428
|
-
q = modal.Queue.lookup("my-queue")
|
|
429
|
-
q.put(123)
|
|
430
|
-
```
|
|
782
|
+
DEPRECATED: This method is deprecated; we recommend using `modal.Queue.objects.delete` instead.
|
|
431
783
|
"""
|
|
432
784
|
...
|
|
433
785
|
|
|
434
|
-
|
|
786
|
+
delete: __delete_spec
|
|
435
787
|
|
|
436
|
-
class
|
|
437
|
-
def __call__(
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
name: str,
|
|
441
|
-
*,
|
|
442
|
-
client: typing.Optional[modal.client.Client] = None,
|
|
443
|
-
environment_name: typing.Optional[str] = None,
|
|
444
|
-
): ...
|
|
445
|
-
async def aio(
|
|
446
|
-
self,
|
|
447
|
-
/,
|
|
448
|
-
name: str,
|
|
449
|
-
*,
|
|
450
|
-
client: typing.Optional[modal.client.Client] = None,
|
|
451
|
-
environment_name: typing.Optional[str] = None,
|
|
452
|
-
): ...
|
|
788
|
+
class __info_spec(typing_extensions.Protocol[SUPERSELF]):
|
|
789
|
+
def __call__(self, /) -> QueueInfo:
|
|
790
|
+
"""Return information about the Queue object."""
|
|
791
|
+
...
|
|
453
792
|
|
|
454
|
-
|
|
793
|
+
async def aio(self, /) -> QueueInfo:
|
|
794
|
+
"""Return information about the Queue object."""
|
|
795
|
+
...
|
|
796
|
+
|
|
797
|
+
info: __info_spec[typing_extensions.Self]
|
|
455
798
|
|
|
456
799
|
class ___get_nonblocking_spec(typing_extensions.Protocol[SUPERSELF]):
|
|
457
800
|
def __call__(self, /, partition: typing.Optional[str], n_values: int) -> list[typing.Any]: ...
|