dbos 0.10.0a1__py3-none-any.whl → 0.10.0a3__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 dbos might be problematic. Click here for more details.
- dbos/dbos.py +29 -6
- {dbos-0.10.0a1.dist-info → dbos-0.10.0a3.dist-info}/METADATA +9 -9
- {dbos-0.10.0a1.dist-info → dbos-0.10.0a3.dist-info}/RECORD +6 -6
- {dbos-0.10.0a1.dist-info → dbos-0.10.0a3.dist-info}/WHEEL +0 -0
- {dbos-0.10.0a1.dist-info → dbos-0.10.0a3.dist-info}/entry_points.txt +0 -0
- {dbos-0.10.0a1.dist-info → dbos-0.10.0a3.dist-info}/licenses/LICENSE +0 -0
dbos/dbos.py
CHANGED
|
@@ -277,6 +277,7 @@ class DBOS:
|
|
|
277
277
|
self.fastapi: Optional["FastAPI"] = fastapi
|
|
278
278
|
self.flask: Optional["Flask"] = flask
|
|
279
279
|
self._executor_field: Optional[ThreadPoolExecutor] = None
|
|
280
|
+
self._background_threads: List[threading.Thread] = []
|
|
280
281
|
|
|
281
282
|
# If using FastAPI, set up middleware and lifecycle events
|
|
282
283
|
if self.fastapi is not None:
|
|
@@ -358,20 +359,38 @@ class DBOS:
|
|
|
358
359
|
self._executor.submit(_startup_recovery_thread, self, workflow_ids)
|
|
359
360
|
|
|
360
361
|
# Listen to notifications
|
|
361
|
-
|
|
362
|
+
notification_listener_thread = threading.Thread(
|
|
363
|
+
target=self._sys_db._notification_listener,
|
|
364
|
+
daemon=True,
|
|
365
|
+
)
|
|
366
|
+
notification_listener_thread.start()
|
|
367
|
+
self._background_threads.append(notification_listener_thread)
|
|
362
368
|
|
|
363
369
|
# Start flush workflow buffers thread
|
|
364
|
-
|
|
370
|
+
flush_workflow_buffers_thread = threading.Thread(
|
|
371
|
+
target=self._sys_db.flush_workflow_buffers,
|
|
372
|
+
daemon=True,
|
|
373
|
+
)
|
|
374
|
+
flush_workflow_buffers_thread.start()
|
|
375
|
+
self._background_threads.append(flush_workflow_buffers_thread)
|
|
365
376
|
|
|
366
377
|
# Start the queue thread
|
|
367
378
|
evt = threading.Event()
|
|
368
379
|
self.stop_events.append(evt)
|
|
369
|
-
|
|
380
|
+
bg_queue_thread = threading.Thread(
|
|
381
|
+
target=queue_thread, args=(evt, self), daemon=True
|
|
382
|
+
)
|
|
383
|
+
bg_queue_thread.start()
|
|
384
|
+
self._background_threads.append(bg_queue_thread)
|
|
370
385
|
|
|
371
386
|
# Grab any pollers that were deferred and start them
|
|
372
387
|
for evt, func, args, kwargs in self._registry.pollers:
|
|
373
388
|
self.stop_events.append(evt)
|
|
374
|
-
|
|
389
|
+
poller_thread = threading.Thread(
|
|
390
|
+
target=func, args=args, kwargs=kwargs, daemon=True
|
|
391
|
+
)
|
|
392
|
+
poller_thread.start()
|
|
393
|
+
self._background_threads.append(poller_thread)
|
|
375
394
|
self._registry.pollers = []
|
|
376
395
|
|
|
377
396
|
dbos_logger.info("DBOS launched")
|
|
@@ -403,6 +422,8 @@ class DBOS:
|
|
|
403
422
|
if self._executor_field is not None:
|
|
404
423
|
self._executor_field.shutdown(cancel_futures=True)
|
|
405
424
|
self._executor_field = None
|
|
425
|
+
for bg_thread in self._background_threads:
|
|
426
|
+
bg_thread.join()
|
|
406
427
|
|
|
407
428
|
@classmethod
|
|
408
429
|
def register_instance(cls, inst: object) -> None:
|
|
@@ -832,7 +853,7 @@ class DBOSConfiguredInstance:
|
|
|
832
853
|
|
|
833
854
|
# Apps that import DBOS probably don't exit. If they do, let's see if
|
|
834
855
|
# it looks like startup was abandoned or a call was forgotten...
|
|
835
|
-
def
|
|
856
|
+
def dbos_exit_hook() -> None:
|
|
836
857
|
if _dbos_global_registry is None:
|
|
837
858
|
# Probably used as or for a support module
|
|
838
859
|
return
|
|
@@ -846,7 +867,9 @@ def log_exit_info() -> None:
|
|
|
846
867
|
print("DBOS exiting; DBOS exists but launch() was not called")
|
|
847
868
|
dbos_logger.warning("DBOS exiting; DBOS exists but launch() was not called")
|
|
848
869
|
return
|
|
870
|
+
# If we get here, we're exiting normally
|
|
871
|
+
_dbos_global_instance.destroy()
|
|
849
872
|
|
|
850
873
|
|
|
851
874
|
# Register the exit hook
|
|
852
|
-
atexit.register(
|
|
875
|
+
atexit.register(dbos_exit_hook)
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dbos
|
|
3
|
-
Version: 0.10.
|
|
3
|
+
Version: 0.10.0a3
|
|
4
4
|
Summary: Ultra-lightweight durable execution in Python
|
|
5
5
|
Author-Email: "DBOS, Inc." <contact@dbos.dev>
|
|
6
6
|
License: MIT
|
|
7
7
|
Requires-Python: >=3.9
|
|
8
8
|
Requires-Dist: pyyaml>=6.0.2
|
|
9
9
|
Requires-Dist: jsonschema>=4.23.0
|
|
10
|
-
Requires-Dist: alembic>=1.13.
|
|
10
|
+
Requires-Dist: alembic>=1.13.3
|
|
11
11
|
Requires-Dist: typing-extensions>=4.12.2; python_version < "3.10"
|
|
12
|
-
Requires-Dist: typer>=0.12.
|
|
13
|
-
Requires-Dist: jsonpickle>=3.
|
|
14
|
-
Requires-Dist: opentelemetry-api>=1.
|
|
15
|
-
Requires-Dist: opentelemetry-sdk>=1.
|
|
16
|
-
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.
|
|
12
|
+
Requires-Dist: typer>=0.12.5
|
|
13
|
+
Requires-Dist: jsonpickle>=3.3.0
|
|
14
|
+
Requires-Dist: opentelemetry-api>=1.27.0
|
|
15
|
+
Requires-Dist: opentelemetry-sdk>=1.27.0
|
|
16
|
+
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.27.0
|
|
17
17
|
Requires-Dist: python-dateutil>=2.9.0.post0
|
|
18
|
-
Requires-Dist: fastapi[standard]>=0.
|
|
18
|
+
Requires-Dist: fastapi[standard]>=0.115.2
|
|
19
19
|
Requires-Dist: psutil>=6.0.0
|
|
20
20
|
Requires-Dist: tomlkit>=0.13.2
|
|
21
|
-
Requires-Dist: psycopg>=3.2.
|
|
21
|
+
Requires-Dist: psycopg>=3.2.3
|
|
22
22
|
Description-Content-Type: text/markdown
|
|
23
23
|
|
|
24
24
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
dbos-0.10.
|
|
2
|
-
dbos-0.10.
|
|
3
|
-
dbos-0.10.
|
|
4
|
-
dbos-0.10.
|
|
1
|
+
dbos-0.10.0a3.dist-info/METADATA,sha256=roY_0GAr3DuV8ANrXdYcyub6TJlWFemSmwZV6zjGRmc,5011
|
|
2
|
+
dbos-0.10.0a3.dist-info/WHEEL,sha256=pM0IBB6ZwH3nkEPhtcp50KvKNX-07jYtnb1g1m6Z4Co,90
|
|
3
|
+
dbos-0.10.0a3.dist-info/entry_points.txt,sha256=z6GcVANQV7Uw_82H9Ob2axJX6V3imftyZsljdh-M1HU,54
|
|
4
|
+
dbos-0.10.0a3.dist-info/licenses/LICENSE,sha256=VGZit_a5-kdw9WT6fY5jxAWVwGQzgLFyPWrcVVUhVNU,1067
|
|
5
5
|
dbos/__init__.py,sha256=-h1QgWNL11CiLlHEKa2ycAJVJw5SXYZ4BGNNWBAiE9k,726
|
|
6
6
|
dbos/admin_sever.py,sha256=Qg5T3YRrbPW05PR_99yAaxgo1ugQrAp_uTeTqSfjm_k,3397
|
|
7
7
|
dbos/application_database.py,sha256=knFK8We8y6WrIpnFCKvFq5hvSuFQqUuJqOqDpSVMCPI,5521
|
|
@@ -9,7 +9,7 @@ dbos/cli.py,sha256=z5dXbbnGWzSC3E1rfS8Lp1_OIImzcDKM7jP-iu_Q4aI,8602
|
|
|
9
9
|
dbos/context.py,sha256=4MsxZdoh1WIsgoUsaxo0B6caGN6xq2WC60MzbBppzGk,17738
|
|
10
10
|
dbos/core.py,sha256=ggsRC2XicvNI1qqruEFoqxoTU5oSSnhMZvDih3AG_3A,30879
|
|
11
11
|
dbos/dbos-config.schema.json,sha256=GQAxrtERczP-ANpzJJJbhCp_CUtQ8pUcH87AqlyC02A,5697
|
|
12
|
-
dbos/dbos.py,sha256=
|
|
12
|
+
dbos/dbos.py,sha256=4_jOtcjoJdIF27wjs_jpsrl-LsyhZ22rod8J1UgKo1E,31021
|
|
13
13
|
dbos/dbos_config.py,sha256=N48Ll-57lKVuh4SF3sLD4W4VnuELAGYA71j3oZPc6Sw,5622
|
|
14
14
|
dbos/decorators.py,sha256=lbPefsLK6Cya4cb7TrOcLglOpGT3pc6qjZdsQKlfZLg,629
|
|
15
15
|
dbos/error.py,sha256=UETk8CoZL-TO2Utn1-E7OSWelhShWmKM-fOlODMR9PE,3893
|
|
@@ -51,4 +51,4 @@ dbos/templates/hello/start_postgres_docker.py,sha256=lQVLlYO5YkhGPEgPqwGc7Y8uDKs
|
|
|
51
51
|
dbos/tracer.py,sha256=GaXDhdKKF_IQp5SAMipGXiDVwteRKjNbrXyYCH1mor0,2520
|
|
52
52
|
dbos/utils.py,sha256=lwRymY-y7GprAS8pKmbICQvOJd5eGxKGTxCMFn0OwaQ,1739
|
|
53
53
|
version/__init__.py,sha256=L4sNxecRuqdtSFdpUGX3TtBi9KL3k7YsZVIvv-fv9-A,1678
|
|
54
|
-
dbos-0.10.
|
|
54
|
+
dbos-0.10.0a3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|