Skip to content

Commit

Permalink
Configure ThreadLoop to be daemon
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
eskildsf authored Jan 21, 2024
1 parent 3268568 commit 1cdbf48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion asyncua/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1cdbf48

Please sign in to comment.