Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion ws4py/client/threadedclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,19 @@ def run_forever(self):
"""
Simply blocks the thread until the
websocket has terminated.

.. note::

Signals and threads do not always play well together in Python.
Without a timeout, this method cannot be interrupted by a
SIGINT (KeyboardInterrupt). The timeout ensures we return to
the main thread periodically so pending signals can be
processed. A longer timeout reduces CPU usage in idle
processes at the cost of slightly slower signal response.
Override this method if you need different behaviour.
"""
while not self.terminated:
self._th.join(timeout=0.1)
self._th.join(timeout=5.0)

def handshake_ok(self):
"""
Expand Down
Loading