From 2fa84084d48c5dd3e9c47289acec626b185004eb Mon Sep 17 00:00:00 2001 From: m5l14i11 Date: Wed, 11 Sep 2024 22:21:41 +0300 Subject: [PATCH] upd --- core/interfaces/abstract_ws.py | 4 ++++ feed/_realtime.py | 1 + 2 files changed, 5 insertions(+) diff --git a/core/interfaces/abstract_ws.py b/core/interfaces/abstract_ws.py index 1d10d367..92fa5196 100644 --- a/core/interfaces/abstract_ws.py +++ b/core/interfaces/abstract_ws.py @@ -9,6 +9,10 @@ class AbstractWS(ABC): def run(self): pass + @abstractmethod + def close(self): + pass + @abstractmethod def receive(self, symbol: Symbol, timeframe: Timeframe): pass diff --git a/feed/_realtime.py b/feed/_realtime.py index 3d3e28bf..5ad4ce4a 100644 --- a/feed/_realtime.py +++ b/feed/_realtime.py @@ -31,6 +31,7 @@ async def __aenter__(self): async def __aexit__(self, exc_type, exc_value, traceback): await self.ws.unsubscribe(self.symbol, self.timeframe) + await self.ws.close() return self def __aiter__(self):