MCPcopy Create free account
hub / github.com/sammchardy/python-binance / recv

Method recv

binance/ws/depthcache.py:191–201  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

189 await self._socket.__aexit__(*args, **kwargs)
190
191 async def recv(self):
192 dc = None
193 while not dc:
194 try:
195 res = await asyncio.wait_for(self._socket.recv(), timeout=self.TIMEOUT)
196 self._log.debug(f"Received message: {res}")
197 except Exception as e:
198 self._log.warning(f"Exception recieving message: {e.__class__.__name__} (e) ")
199 else:
200 dc = await self._depth_event(res)
201 return dc
202
203 async def _init_cache(self):
204 """Initialise the depth cache calling REST endpoint

Calls 1

_depth_eventMethod · 0.95