Skip to content

Commit 9d8328d

Browse files
committed
daemonize websocket thread (kill when main exits)
from https://docs.python.org/2/library/threading.html: ``` A thread can be flagged as a “daemon thread”. The significance of this flag is that the entire Python program exits when only daemon threads are left. The initial value is inherited from the creating thread. The flag can be set through the daemon property. ```
1 parent 510c325 commit 9d8328d

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

GDAX/WebsocketClient.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def go():
2121
self.listen()
2222

2323
self.thread = Thread(target=go)
24+
self.thread.daemon = True
2425
self.thread.start()
2526

2627
def connect(self):

0 commit comments

Comments
 (0)