1
0
mirror of https://github.com/FreeOpcUa/opcua-asyncio synced 2025-10-29 17:07:18 +08:00

Configure ThreadLoop to be daemon

Configuring a sync Client object and connecting it to an OPC-UA host will cause the calling script to hang on exit if disconnect() is not called. By setting the ThreadLoop to be a daemon resolves this issue.
This commit is contained in:
Eskild Schroll-Fleischer
2024-01-21 16:53:47 +01:00
committed by GitHub
parent 3268568df3
commit 1cdbf483b8

View File

@@ -34,7 +34,7 @@ class ThreadLoopNotRunning(Exception):
class ThreadLoop(Thread):
def __init__(self, timeout: Optional[float] = 120) -> None:
Thread.__init__(self)
Thread.__init__(self, daemon=True)
self.loop = None
self._cond = Condition()
self.timeout = timeout