[Add] only keep stream after connected

This commit is contained in:
vn.py 2019-10-29 15:02:36 +08:00
parent 6b11836816
commit af3e90c280

View File

@ -107,8 +107,6 @@ class BinanceGateway(BaseGateway):
self.market_ws_api = BinanceDataWebsocketApi(self)
self.rest_api = BinanceRestApi(self)
self.event_engine.register(EVENT_TIMER, self.process_timer_event)
def connect(self, setting: dict):
""""""
key = setting["key"]
@ -121,6 +119,8 @@ class BinanceGateway(BaseGateway):
proxy_host, proxy_port)
self.market_ws_api.connect(proxy_host, proxy_port)
self.event_engine.register(EVENT_TIMER, self.process_timer_event)
def subscribe(self, req: SubscribeRequest):
""""""
self.market_ws_api.subscribe(req)