sammchardy / python-binance

Binance Exchange API python implementation for automated trading
https://python-binance.readthedocs.io/en/latest/
MIT License
5.96k stars 2.19k forks source link

generalize ThreadedApiManager nomenclature beyond sockets. #1254

Closed j4mesim closed 1 year ago

j4mesim commented 1 year ago

This PR generalizes the nomenclature in ThreadedApiManager from referring to every type of listener as a socket to a a generic listener object of type AbstractListener. AbstractListener subclasses AbstractAsyncContextManager with a definition for async def recv(self) and has children BaseDepthCacheManager and ReconnectingWebsocket.

I couldn't find where to put the interface so I put it in its own file listeners.py.