websocket: add subscriptions to status channel functionality

This commit is contained in:
Jacob Plaster
2019-07-19 14:32:56 +07:00
committed by Jacob Plaster
parent 3e3c55034d
commit ac20a7530a
3 changed files with 52 additions and 5 deletions

View File

@@ -32,7 +32,7 @@ class SubscriptionManager:
count += 1
return count
async def subscribe(self, channel_name, symbol, timeframe=None, **kwargs):
async def subscribe(self, channel_name, symbol, key=None, timeframe=None, **kwargs):
"""
Subscribe to a new channel
@@ -51,7 +51,7 @@ class SubscriptionManager:
socket = self.bfxapi.get_most_available_socket()
# create a new subscription
subscription = Subscription(
socket, channel_name, symbol, timeframe, **kwargs)
socket, channel_name, symbol, key, timeframe, **kwargs)
self.logger.info("Subscribing to channel {}".format(channel_name))
self.pending_subscriptions[subscription.get_key()] = subscription