pikers / piker

(e2e) foss trading for non-tinas
GNU Affero General Public License v3.0
102 stars 17 forks source link

`binance`: use built-in `anext()` add note about new ws ep URL, fix agen streaming within `NoBsWs` usage #473

Closed goodboy closed 1 year ago

goodboy commented 1 year ago

Not sure why this ain't workin for me (but maybe someone else can test to verify?) but I tried updating the latest documented WS endpoint and it doesn't seem to ever work 😂

Further this starts using the new built-in anext() routines instead of the dunders we had to use prior.


ALSO ~updates the streamer async-gen with an aclosing() which is super critical to avoid trio crashes on re-connection logic!~

INSTEAD uses @trio_util.trio_async_generator which actually solves the underlying issue of allowing an agen to work through multiple cancel scopes as is needed by our NoBsWs reconnection logic.. => in 609b91e

goodboy commented 1 year ago

Ahh shoot, i guess you have to checkout and uncomment the other ep url line 😂

here's their docs on this: https://developers.binance.com/docs/binance-trading-api/websocket_api#general-api-information

no idea what's up, but obviously as per this patch, we were using 'wss://stream.binance.com/ws'

goodboy commented 1 year ago

Turns out this didn't end up workin that well 😂

Had to do a full rewrite in 59743b7b736957596@#489