Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit 481eab0

Browse files
committed
Threads rename, example comment update, readme fix async.
1 parent 3c207bd commit 481eab0

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ async def on_public(self, msg):
154154
async def on_private(self, msg):
155155
# The main channel for all private methods.
156156

157-
def on_error(self, error):
157+
async def on_error(self, error):
158158
# Receive error message from the SignalR connection.
159159

160160
```

bittrex_websocket/websocket_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def __init__(self, url=None):
3838
def _start_main_thread(self):
3939
self.control_queue = Queue()
4040
self.control_queue.put(ConnectEvent())
41-
thread = Thread(target=self.control_queue_handler, daemon=True, name='ControlQueue')
41+
thread = Thread(target=self.control_queue_handler, daemon=True, name='ControlQueueThread')
4242
self.threads.append(thread)
4343
thread.start()
4444

@@ -68,7 +68,7 @@ def _handle_connect(self):
6868
hub.client.on(BittrexParameters.BALANCE_DELTA, self._on_private)
6969
hub.client.on(BittrexParameters.ORDER_DELTA, self._on_private)
7070
self.connection = BittrexConnection(connection, hub)
71-
thread = Thread(target=self._connection_handler, daemon=True, name='SocketConnection')
71+
thread = Thread(target=self._connection_handler, daemon=True, name='SocketConnectionThread')
7272
self.threads.append(thread)
7373
thread.start()
7474

examples/ticker_updates.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
# /examples/ticker_updates.py
55
# Stanislav Lazarov
66

7-
# Sample script to show how subscribe_to_exchange_deltas() works.
7+
# Sample script showing how subscribe_to_exchange_deltas() works.
8+
89
# Overview:
9-
# Creates a custom ticker_updates_container dict.
10-
# Subscribes to N tickers to get their general information.
11-
# When information is received, checks if the ticker is
12-
# in ticker_updates_container and adds it if not.
13-
# Disconnects when it has the information for each ticker.
10+
# ---------
11+
# 1) Creates a custom ticker_updates_container dict.
12+
# 2) Subscribes to N tickers to get their general information.
13+
# 3) When information is received, checks if the ticker is
14+
# in ticker_updates_container and adds it if not.
15+
# 4) Disconnects when it has the information for each ticker.
1416

1517
from bittrex_websocket.websocket_client import BittrexSocket
1618
from time import sleep
@@ -42,8 +44,8 @@ async def on_public(self, msg):
4244
sleep(0.01)
4345
ws.subscribe_to_exchange_deltas([ticker])
4446

45-
# Users can also subscribe without introducing delays in invoking but
46-
# it is recommended when you are subscribing to a large list of tickers.
47+
# Users can also subscribe without introducing delays during invoking but
48+
# it is the recommended way when you are subscribing to a large list of tickers.
4749
# ws.subscribe_to_exchange_deltas(tickers)
4850

4951
while len(ws.ticker_updates_container) < len(tickers):

0 commit comments

Comments
 (0)