(self)
| 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 |