Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[+] WebsocketClient thread naming #351

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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
7 changes: 4 additions & 3 deletions cbpro/websocket_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should reference self.thread_name instead.

self.keepalive = Thread(target=self._keepalive, name=keeaplive_thread_name)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should reference self.keepalive_thread_name. Also there is a typo in "keepalive"

self.thread.start()

def _connect(self):
Expand Down