Make processes identifiable with uuid4 (#91)

* make processes identifiable

* update docs
This commit is contained in:
Stan Triepels
2023-05-14 03:07:38 +02:00
committed by GitHub
parent 227caa7446
commit 630b3c62b3
2 changed files with 28 additions and 27 deletions
+2 -1
View File
@@ -69,6 +69,7 @@ class Cluster:
self.start_event = Event()
self.sentinel = Process(
target=Sentinel,
name=f"Process-{uuid.uuid4().hex}",
args=(
self.stop_event,
self.start_event,
@@ -196,7 +197,7 @@ class Sentinel:
"""
:type target: function or class
"""
p = Process(target=target, args=args)
p = Process(target=target, args=args, name=f"Process-{uuid.uuid4().hex}")
p.daemon = True
if target == worker:
p.daemon = Conf.DAEMONIZE_WORKERS