Add implementation for BfxWebSocketClient::resubscribe and BfxWebSocketBucket::resubscribe.

This commit is contained in:
Davide Casale
2023-07-28 17:29:41 +02:00
parent 26f25e5848
commit f39b054397
2 changed files with 20 additions and 1 deletions

View File

@@ -311,6 +311,12 @@ class BfxWebSocketClient(Connection, Connection.Authenticable):
if bucket.has(sub_id=sub_id):
await bucket.unsubscribe(sub_id=sub_id)
@Connection.require_websocket_connection
async def resubscribe(self, sub_id: str) -> None:
for bucket in self.__buckets:
if bucket.has(sub_id=sub_id):
await bucket.resubscribe(sub_id=sub_id)
@Connection.require_websocket_connection
async def close(self, code: int = 1000, reason: str = str()) -> None:
for bucket in self.__buckets: