Remove anext() comment
parent
11bd2e2f65
commit
9f5dfe8501
|
@ -282,7 +282,7 @@ class Client:
|
||||||
entries = await self._request('GET', '/symbols')
|
entries = await self._request('GET', '/symbols')
|
||||||
syms = {kucoin_sym_to_fqsn(item['name']): KucoinMktPair(**item) for item in entries}
|
syms = {kucoin_sym_to_fqsn(item['name']): KucoinMktPair(**item) for item in entries}
|
||||||
|
|
||||||
log.info(f' {syms.length} Kucoin market pairs fetched')
|
log.info(f' {len(syms)} Kucoin market pairs fetched')
|
||||||
return syms
|
return syms
|
||||||
|
|
||||||
async def cache_pairs(
|
async def cache_pairs(
|
||||||
|
@ -342,7 +342,6 @@ class Client:
|
||||||
kucoin_sym = fqsn_to_kucoin_sym(fqsn, self._pairs)
|
kucoin_sym = fqsn_to_kucoin_sym(fqsn, self._pairs)
|
||||||
|
|
||||||
url = f'/market/candles?type={type}&symbol={kucoin_sym}&startAt={start_dt}&endAt={end_dt}'
|
url = f'/market/candles?type={type}&symbol={kucoin_sym}&startAt={start_dt}&endAt={end_dt}'
|
||||||
bars = []
|
|
||||||
|
|
||||||
for i in range(10):
|
for i in range(10):
|
||||||
data = await self._request(
|
data = await self._request(
|
||||||
|
@ -358,7 +357,7 @@ class Client:
|
||||||
f'History call failed, backing off for {backoff_interval}s')
|
f'History call failed, backing off for {backoff_interval}s')
|
||||||
await trio.sleep(backoff_interval)
|
await trio.sleep(backoff_interval)
|
||||||
else:
|
else:
|
||||||
bars = data
|
bars: list[list[str]] = data
|
||||||
break
|
break
|
||||||
|
|
||||||
# Map to OHLC values to dict then to np array
|
# Map to OHLC values to dict then to np array
|
||||||
|
@ -465,6 +464,7 @@ async def stream_quotes(
|
||||||
}
|
}
|
||||||
@acm
|
@acm
|
||||||
async def subscribe(ws: wsproto.WSConnection):
|
async def subscribe(ws: wsproto.WSConnection):
|
||||||
|
|
||||||
@acm
|
@acm
|
||||||
async def open_ping_task(ws: wsproto.WSConnection):
|
async def open_ping_task(ws: wsproto.WSConnection):
|
||||||
'''
|
'''
|
||||||
|
@ -523,7 +523,6 @@ async def stream_quotes(
|
||||||
typ, quote = await anext(msg_gen)
|
typ, quote = await anext(msg_gen)
|
||||||
|
|
||||||
while typ != 'trade':
|
while typ != 'trade':
|
||||||
# TODO: use ``anext()`` when it lands in 3.10!
|
|
||||||
typ, quote = await anext(msg_gen)
|
typ, quote = await anext(msg_gen)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue