Skip to content

Commit 3f5378b

Browse files
Close the websocket connection
1 parent e2649c3 commit 3f5378b

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

kraken/futures/ws_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ async def start(self: FuturesWSClient) -> None:
153153
else:
154154
raise TimeoutError("Could not connect to the Kraken API!")
155155

156-
async def stop(self: FuturesWSClient) -> None:
157-
"""Method to stop the websocket connection."""
156+
async def close(self: FuturesWSClient) -> None:
157+
"""Method to close the websocket connection."""
158158
if self._conn:
159159
await self._conn.stop()
160160
await super().close()
@@ -444,7 +444,7 @@ async def __aexit__(
444444
) -> None:
445445
"""Exit if used as context manager"""
446446
await super().__aexit__()
447-
await self.stop()
447+
await self.close()
448448

449449

450450
__all__ = ["FuturesWSClient"]

kraken/spot/websocket/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ async def start(self: SpotWSClientBase) -> None:
137137
else:
138138
raise TimeoutError("Could not connect to the Kraken API!")
139139

140-
async def stop(self: SpotWSClientBase) -> None:
141-
"""Method to stop the websocket connection."""
140+
async def close(self: SpotWSClientBase) -> None:
141+
"""Method to close the websocket connection."""
142142
if self._pub_conn:
143143
await self._pub_conn.stop()
144144
if self._priv_conn:
@@ -185,7 +185,7 @@ async def __aexit__(
185185
) -> None:
186186
"""Exit if used as context manager"""
187187
await super().__aexit__()
188-
await self.stop()
188+
await self.close()
189189

190190
async def get_ws_token(self: SpotWSClientBase) -> dict:
191191
"""

tests/futures/test_futures_websocket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ async def instantiate_client() -> None:
3434
await client.start()
3535
await async_sleep(4)
3636
assert not client.is_auth
37-
await client.stop()
37+
await client.close()
3838
await async_sleep(2)
3939

4040
asyncio.run(instantiate_client())

tests/spot/test_spot_websocket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async def create_client() -> None:
4646
client = SpotWebsocketClientTestWrapper()
4747
await client.start()
4848
await async_sleep(5)
49-
await client.stop()
49+
await client.close()
5050

5151
asyncio_run(create_client())
5252

0 commit comments

Comments
 (0)