diff --git a/cbpro/websocket_client.py b/cbpro/websocket_client.py index f1b0f97..aace370 100644 --- a/cbpro/websocket_client.py +++ b/cbpro/websocket_client.py @@ -19,7 +19,8 @@ class WebsocketClient(object): def __init__(self, url="wss://ws-feed.pro.coinbase.com", products=None, message_type="subscribe", mongo_collection=None, - should_print=True, auth=False, api_key="", api_secret="", api_passphrase="", channels=None): + should_print=True, auth=False, api_key="", api_secret="", api_passphrase="", channels=None, + thread_name='WebsocketClient', keepalive_thread_name='WebsocketClientKeepAlive'): self.url = url self.products = products self.channels = channels @@ -43,8 +44,8 @@ def _go(): self.stop = False self.on_open() - self.thread = Thread(target=_go) - self.keepalive = Thread(target=self._keepalive) + self.thread = Thread(target=_go, name=thread_name) + self.keepalive = Thread(target=self._keepalive, name=keeaplive_thread_name) self.thread.start() def _connect(self):