Rename event <disconnection> to <disconnected> (to mantain compliance).

This commit is contained in:
Davide Casale
2023-10-01 21:37:43 +02:00
parent 8a1632d3c2
commit ca4050a35b
3 changed files with 5 additions and 5 deletions

View File

@@ -181,10 +181,10 @@ A custom [close code number](https://www.iana.org/assignments/websocket/websocke
await bfx.wss.close(code=1001, reason="Going Away")
```
After closing the connection, the client will emit the `disconnection` event:
After closing the connection, the client will emit the `disconnected` event:
```python
@bfx.wss.on("disconnection")
def on_disconnection(code: int, reason: str):
@bfx.wss.on("disconnected")
def on_disconnected(code: int, reason: str):
if code == 1000 or code == 1001:
print("Closing the connection without errors!")
```

View File

@@ -206,7 +206,7 @@ class BfxWebSocketClient(Connection, Connection.Authenticable):
raise error
if not self.__reconnection:
self.__event_emitter.emit("disconnection",
self.__event_emitter.emit("disconnected",
self._websocket.close_code, \
self._websocket.close_reason)

View File

@@ -9,7 +9,7 @@ from pyee.asyncio import AsyncIOEventEmitter
from bfxapi.websocket.exceptions import UnknownEventError
_ONCE_PER_CONNECTION = [
"open", "authenticated", "disconnection",
"open", "authenticated", "disconnected",
"order_snapshot", "position_snapshot", "funding_offer_snapshot",
"funding_credit_snapshot", "funding_loan_snapshot", "wallet_snapshot"
]