Rewrite reconnection system with numerous fixes.

This commit is contained in:
Davide Casale
2023-02-15 21:48:34 +01:00
parent 99f58ddb04
commit fa9bdfc333
9 changed files with 98 additions and 60 deletions

View File

@@ -3,7 +3,7 @@
from bfxapi import Client, Constants
from bfxapi.websocket import subscriptions
from bfxapi.websocket.enums import Channels
from bfxapi.websocket.enums import Channel
from bfxapi.websocket.types import TradingPairTicker
bfx = Client(WSS_HOST=Constants.PUB_WSS_HOST)
@@ -16,6 +16,6 @@ def on_t_ticker_update(subscription: subscriptions.Ticker, data: TradingPairTick
@bfx.wss.once("open")
async def open():
await bfx.wss.subscribe(Channels.TICKER, symbol="tBTCUSD")
await bfx.wss.subscribe(Channel.TICKER, symbol="tBTCUSD")
bfx.wss.run()