dbos 1.2.0a9__py3-none-any.whl → 1.3.0a1__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.
- dbos/_sys_db.py +27 -27
- {dbos-1.2.0a9.dist-info → dbos-1.3.0a1.dist-info}/METADATA +1 -1
- {dbos-1.2.0a9.dist-info → dbos-1.3.0a1.dist-info}/RECORD +6 -6
- {dbos-1.2.0a9.dist-info → dbos-1.3.0a1.dist-info}/WHEEL +0 -0
- {dbos-1.2.0a9.dist-info → dbos-1.3.0a1.dist-info}/entry_points.txt +0 -0
- {dbos-1.2.0a9.dist-info → dbos-1.3.0a1.dist-info}/licenses/LICENSE +0 -0
dbos/_sys_db.py
CHANGED
@@ -1385,35 +1385,35 @@ class SystemDatabase:
|
|
1385
1385
|
payload = f"{workflow_uuid}::{topic}"
|
1386
1386
|
condition = threading.Condition()
|
1387
1387
|
# Must acquire first before adding to the map. Otherwise, the notification listener may notify it before the condition is acquired and waited.
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
|
1394
|
-
raise DBOSWorkflowConflictIDError(workflow_uuid)
|
1388
|
+
try:
|
1389
|
+
condition.acquire()
|
1390
|
+
success, _ = self.notifications_map.set(payload, condition)
|
1391
|
+
if not success:
|
1392
|
+
# This should not happen, but if it does, it means the workflow is executed concurrently.
|
1393
|
+
raise DBOSWorkflowConflictIDError(workflow_uuid)
|
1395
1394
|
|
1396
|
-
|
1397
|
-
|
1398
|
-
|
1399
|
-
|
1400
|
-
|
1401
|
-
|
1402
|
-
|
1403
|
-
|
1404
|
-
|
1405
|
-
|
1406
|
-
|
1395
|
+
# Check if the key is already in the database. If not, wait for the notification.
|
1396
|
+
init_recv: Sequence[Any]
|
1397
|
+
with self.engine.begin() as c:
|
1398
|
+
init_recv = c.execute(
|
1399
|
+
sa.select(
|
1400
|
+
SystemSchema.notifications.c.topic,
|
1401
|
+
).where(
|
1402
|
+
SystemSchema.notifications.c.destination_uuid == workflow_uuid,
|
1403
|
+
SystemSchema.notifications.c.topic == topic,
|
1404
|
+
)
|
1405
|
+
).fetchall()
|
1407
1406
|
|
1408
|
-
|
1409
|
-
|
1410
|
-
|
1411
|
-
|
1412
|
-
|
1413
|
-
|
1414
|
-
|
1415
|
-
|
1416
|
-
|
1407
|
+
if len(init_recv) == 0:
|
1408
|
+
# Wait for the notification
|
1409
|
+
# Support OAOO sleep
|
1410
|
+
actual_timeout = self.sleep(
|
1411
|
+
workflow_uuid, timeout_function_id, timeout_seconds, skip_sleep=True
|
1412
|
+
)
|
1413
|
+
condition.wait(timeout=actual_timeout)
|
1414
|
+
finally:
|
1415
|
+
condition.release()
|
1416
|
+
self.notifications_map.pop(payload)
|
1417
1417
|
|
1418
1418
|
# Transactionally consume and return the message if it's in the database, otherwise return null.
|
1419
1419
|
with self.engine.begin() as c:
|
@@ -1,7 +1,7 @@
|
|
1
|
-
dbos-1.
|
2
|
-
dbos-1.
|
3
|
-
dbos-1.
|
4
|
-
dbos-1.
|
1
|
+
dbos-1.3.0a1.dist-info/METADATA,sha256=HffHfk9xcviv8ws7LqIGcPYBSY7mkbgU23YENeEY2eE,13267
|
2
|
+
dbos-1.3.0a1.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
|
3
|
+
dbos-1.3.0a1.dist-info/entry_points.txt,sha256=_QOQ3tVfEjtjBlr1jS4sHqHya9lI2aIEIWkz8dqYp14,58
|
4
|
+
dbos-1.3.0a1.dist-info/licenses/LICENSE,sha256=VGZit_a5-kdw9WT6fY5jxAWVwGQzgLFyPWrcVVUhVNU,1067
|
5
5
|
dbos/__init__.py,sha256=NssPCubaBxdiKarOWa-wViz1hdJSkmBGcpLX_gQ4NeA,891
|
6
6
|
dbos/__main__.py,sha256=G7Exn-MhGrVJVDbgNlpzhfh8WMX_72t3_oJaFT9Lmt8,653
|
7
7
|
dbos/_admin_server.py,sha256=TWXi4drrzKFpKkUmEJpJkQBZxAtOalnhtYicEn2nDK0,10618
|
@@ -47,7 +47,7 @@ dbos/_schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
47
47
|
dbos/_schemas/application_database.py,sha256=SypAS9l9EsaBHFn9FR8jmnqt01M74d9AF1AMa4m2hhI,1040
|
48
48
|
dbos/_schemas/system_database.py,sha256=3Z0L72bOgHnusK1hBaETWU9RfiLBP0QnS-fdu41i0yY,5835
|
49
49
|
dbos/_serialization.py,sha256=bWuwhXSQcGmiazvhJHA5gwhrRWxtmFmcCFQSDJnqqkU,3666
|
50
|
-
dbos/_sys_db.py,sha256=
|
50
|
+
dbos/_sys_db.py,sha256=KP2wIoytbtFoNzx3-SmobkAn3HhE6tZy_9Vvh8qpUQ8,85780
|
51
51
|
dbos/_templates/dbos-db-starter/README.md,sha256=GhxhBj42wjTt1fWEtwNriHbJuKb66Vzu89G4pxNHw2g,930
|
52
52
|
dbos/_templates/dbos-db-starter/__package/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
53
53
|
dbos/_templates/dbos-db-starter/__package/main.py.dbos,sha256=aQnBPSSQpkB8ERfhf7gB7P9tsU6OPKhZscfeh0yiaD8,2702
|
@@ -67,4 +67,4 @@ dbos/cli/cli.py,sha256=EemOMqNpzSU2BQhAxV_e59pBRITDLwt49HF6W3uWBZg,20775
|
|
67
67
|
dbos/dbos-config.schema.json,sha256=CjaspeYmOkx6Ip_pcxtmfXJTn_YGdSx_0pcPBF7KZmo,6060
|
68
68
|
dbos/py.typed,sha256=QfzXT1Ktfk3Rj84akygc7_42z0lRpCq0Ilh8OXI6Zas,44
|
69
69
|
version/__init__.py,sha256=L4sNxecRuqdtSFdpUGX3TtBi9KL3k7YsZVIvv-fv9-A,1678
|
70
|
-
dbos-1.
|
70
|
+
dbos-1.3.0a1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|