dbos 0.26.0a9__tar.gz → 0.26.0a10__tar.gz
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.
- {dbos-0.26.0a9 → dbos-0.26.0a10}/PKG-INFO +1 -1
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_client.py +123 -2
- {dbos-0.26.0a9 → dbos-0.26.0a10}/pyproject.toml +1 -1
- {dbos-0.26.0a9 → dbos-0.26.0a10}/LICENSE +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/README.md +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/__init__.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/__main__.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_admin_server.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_app_db.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_classproperty.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_conductor/conductor.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_conductor/protocol.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_context.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_core.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_croniter.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_dbos.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_dbos_config.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_debug.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_docker_pg_helper.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_error.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_fastapi.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_flask.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_kafka.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_kafka_message.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_logger.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_migrations/env.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_migrations/script.py.mako +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_migrations/versions/04ca4f231047_workflow_queues_executor_id.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_migrations/versions/50f3227f0b4b_fix_job_queue.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_migrations/versions/5c361fc04708_added_system_tables.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_migrations/versions/a3b18ad34abe_added_triggers.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_migrations/versions/d76646551a6b_job_queue_limiter.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_migrations/versions/d76646551a6c_workflow_queue.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_migrations/versions/eab0cc1d9a14_job_queue.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_migrations/versions/f4b9b32ba814_functionname_childid_op_outputs.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_outcome.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_queue.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_recovery.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_registrations.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_request.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_roles.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_scheduler.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_schemas/__init__.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_schemas/application_database.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_schemas/system_database.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_serialization.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_sys_db.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_templates/dbos-db-starter/README.md +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_templates/dbos-db-starter/__package/__init__.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_templates/dbos-db-starter/__package/main.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_templates/dbos-db-starter/__package/schema.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_templates/dbos-db-starter/alembic.ini +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_templates/dbos-db-starter/dbos-config.yaml.dbos +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_templates/dbos-db-starter/migrations/env.py.dbos +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_templates/dbos-db-starter/migrations/script.py.mako +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_templates/dbos-db-starter/migrations/versions/2024_07_31_180642_init.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_templates/dbos-db-starter/start_postgres_docker.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_tracer.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_utils.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_workflow_commands.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/cli/_github_init.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/cli/_template_init.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/cli/cli.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/dbos-config.schema.json +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/py.typed +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/__init__.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/atexit_no_ctor.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/atexit_no_launch.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/classdefs.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/client_collateral.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/client_worker.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/conftest.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/more_classdefs.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/queuedworkflow.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/test_admin_server.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/test_async.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/test_classdecorators.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/test_client.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/test_concurrency.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/test_config.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/test_croniter.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/test_dbos.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/test_debug.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/test_docker_secrets.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/test_failures.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/test_fastapi.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/test_fastapi_roles.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/test_flask.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/test_kafka.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/test_outcome.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/test_package.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/test_queue.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/test_scheduler.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/test_schema_migration.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/test_singleton.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/test_spans.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/test_sqlalchemy.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/test_workflow_introspection.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/tests/test_workflow_management.py +0 -0
- {dbos-0.26.0a9 → dbos-0.26.0a10}/version/__init__.py +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
import asyncio
|
2
2
|
import sys
|
3
3
|
import uuid
|
4
|
-
from typing import Any, Generic, Optional, TypedDict, TypeVar
|
4
|
+
from typing import Any, Generic, List, Optional, TypedDict, TypeVar
|
5
5
|
|
6
6
|
if sys.version_info < (3, 11):
|
7
7
|
from typing_extensions import NotRequired
|
@@ -15,7 +15,12 @@ from dbos._error import DBOSNonExistentWorkflowError
|
|
15
15
|
from dbos._registrations import DEFAULT_MAX_RECOVERY_ATTEMPTS
|
16
16
|
from dbos._serialization import WorkflowInputs
|
17
17
|
from dbos._sys_db import SystemDatabase, WorkflowStatusInternal, WorkflowStatusString
|
18
|
-
from dbos._workflow_commands import
|
18
|
+
from dbos._workflow_commands import (
|
19
|
+
WorkflowStatus,
|
20
|
+
get_workflow,
|
21
|
+
list_queued_workflows,
|
22
|
+
list_workflows,
|
23
|
+
)
|
19
24
|
|
20
25
|
R = TypeVar("R", covariant=True) # A generic type for workflow return values
|
21
26
|
|
@@ -202,3 +207,119 @@ class DBOSClient:
|
|
202
207
|
return await asyncio.to_thread(
|
203
208
|
self.get_event, workflow_id, key, timeout_seconds
|
204
209
|
)
|
210
|
+
|
211
|
+
def cancel_workflow(self, workflow_id: str) -> None:
|
212
|
+
self._sys_db.cancel_workflow(workflow_id)
|
213
|
+
|
214
|
+
async def cancel_workflow_async(self, workflow_id: str) -> None:
|
215
|
+
await asyncio.to_thread(self.cancel_workflow, workflow_id)
|
216
|
+
|
217
|
+
def resume_workflow(self, workflow_id: str) -> None:
|
218
|
+
self._sys_db.resume_workflow(workflow_id)
|
219
|
+
|
220
|
+
async def resume_workflow_async(self, workflow_id: str) -> None:
|
221
|
+
await asyncio.to_thread(self.resume_workflow, workflow_id)
|
222
|
+
|
223
|
+
def list_workflows(
|
224
|
+
self,
|
225
|
+
*,
|
226
|
+
workflow_ids: Optional[List[str]] = None,
|
227
|
+
status: Optional[str] = None,
|
228
|
+
start_time: Optional[str] = None,
|
229
|
+
end_time: Optional[str] = None,
|
230
|
+
name: Optional[str] = None,
|
231
|
+
app_version: Optional[str] = None,
|
232
|
+
user: Optional[str] = None,
|
233
|
+
limit: Optional[int] = None,
|
234
|
+
offset: Optional[int] = None,
|
235
|
+
sort_desc: bool = False,
|
236
|
+
) -> List[WorkflowStatus]:
|
237
|
+
return list_workflows(
|
238
|
+
self._sys_db,
|
239
|
+
workflow_ids=workflow_ids,
|
240
|
+
status=status,
|
241
|
+
start_time=start_time,
|
242
|
+
end_time=end_time,
|
243
|
+
name=name,
|
244
|
+
app_version=app_version,
|
245
|
+
user=user,
|
246
|
+
limit=limit,
|
247
|
+
offset=offset,
|
248
|
+
sort_desc=sort_desc,
|
249
|
+
)
|
250
|
+
|
251
|
+
async def list_workflows_async(
|
252
|
+
self,
|
253
|
+
*,
|
254
|
+
workflow_ids: Optional[List[str]] = None,
|
255
|
+
status: Optional[str] = None,
|
256
|
+
start_time: Optional[str] = None,
|
257
|
+
end_time: Optional[str] = None,
|
258
|
+
name: Optional[str] = None,
|
259
|
+
app_version: Optional[str] = None,
|
260
|
+
user: Optional[str] = None,
|
261
|
+
limit: Optional[int] = None,
|
262
|
+
offset: Optional[int] = None,
|
263
|
+
sort_desc: bool = False,
|
264
|
+
) -> List[WorkflowStatus]:
|
265
|
+
return await asyncio.to_thread(
|
266
|
+
self.list_workflows,
|
267
|
+
workflow_ids=workflow_ids,
|
268
|
+
status=status,
|
269
|
+
start_time=start_time,
|
270
|
+
end_time=end_time,
|
271
|
+
name=name,
|
272
|
+
app_version=app_version,
|
273
|
+
user=user,
|
274
|
+
limit=limit,
|
275
|
+
offset=offset,
|
276
|
+
sort_desc=sort_desc,
|
277
|
+
)
|
278
|
+
|
279
|
+
def list_queued_workflows(
|
280
|
+
self,
|
281
|
+
*,
|
282
|
+
queue_name: Optional[str] = None,
|
283
|
+
status: Optional[str] = None,
|
284
|
+
start_time: Optional[str] = None,
|
285
|
+
end_time: Optional[str] = None,
|
286
|
+
name: Optional[str] = None,
|
287
|
+
limit: Optional[int] = None,
|
288
|
+
offset: Optional[int] = None,
|
289
|
+
sort_desc: bool = False,
|
290
|
+
) -> List[WorkflowStatus]:
|
291
|
+
return list_queued_workflows(
|
292
|
+
self._sys_db,
|
293
|
+
queue_name=queue_name,
|
294
|
+
status=status,
|
295
|
+
start_time=start_time,
|
296
|
+
end_time=end_time,
|
297
|
+
name=name,
|
298
|
+
limit=limit,
|
299
|
+
offset=offset,
|
300
|
+
sort_desc=sort_desc,
|
301
|
+
)
|
302
|
+
|
303
|
+
async def list_queued_workflows_async(
|
304
|
+
self,
|
305
|
+
*,
|
306
|
+
queue_name: Optional[str] = None,
|
307
|
+
status: Optional[str] = None,
|
308
|
+
start_time: Optional[str] = None,
|
309
|
+
end_time: Optional[str] = None,
|
310
|
+
name: Optional[str] = None,
|
311
|
+
limit: Optional[int] = None,
|
312
|
+
offset: Optional[int] = None,
|
313
|
+
sort_desc: bool = False,
|
314
|
+
) -> List[WorkflowStatus]:
|
315
|
+
return await asyncio.to_thread(
|
316
|
+
self.list_queued_workflows,
|
317
|
+
queue_name=queue_name,
|
318
|
+
status=status,
|
319
|
+
start_time=start_time,
|
320
|
+
end_time=end_time,
|
321
|
+
name=name,
|
322
|
+
limit=limit,
|
323
|
+
offset=offset,
|
324
|
+
sort_desc=sort_desc,
|
325
|
+
)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_migrations/versions/5c361fc04708_added_system_tables.py
RENAMED
File without changes
|
File without changes
|
{dbos-0.26.0a9 → dbos-0.26.0a10}/dbos/_migrations/versions/d76646551a6b_job_queue_limiter.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|