mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-18 22:34:21 +01:00
Rename event <disconnection> to <disconnected> (to mantain compliance).
This commit is contained in:
@@ -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!")
|
||||
```
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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"
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user