Fix and rewrite all logic in class BfxWebSocketBucket.

This commit is contained in:
Davide Casale
2023-10-08 05:37:10 +02:00
parent 628c3a0d66
commit 5ae576e36a
13 changed files with 132 additions and 145 deletions

View File

@@ -4,11 +4,12 @@ __all__ = [
"BfxWebSocketException",
"ConnectionNotOpen",
"TooManySubscriptions",
"FullBucketError",
"ZeroConnectionsError",
"ReconnectionTimeoutError",
"ActionRequiresAuthentication",
"InvalidAuthenticationCredentials",
"UnknownChannelError",
"UnknownEventError",
"OutdatedClientVersion"
]
@@ -23,9 +24,9 @@ class ConnectionNotOpen(BfxWebSocketException):
This error indicates an attempt to communicate via websocket before starting the connection with the servers.
"""
class TooManySubscriptions(BfxWebSocketException):
class FullBucketError(BfxWebSocketException):
"""
This error indicates a subscription attempt after reaching the limit of simultaneous connections.
Thrown when a user attempts a subscription but all buckets are full.
"""
class ZeroConnectionsError(BfxWebSocketException):
@@ -48,9 +49,14 @@ class InvalidAuthenticationCredentials(BfxWebSocketException):
This error indicates that the user has provided incorrect credentials (API-KEY and API-SECRET) for authentication.
"""
class UnknownChannelError(BfxWebSocketException):
"""
Thrown when a user attempts to subscribe to an unknown channel.
"""
class UnknownEventError(BfxWebSocketException):
"""
This error indicates a failed attempt to subscribe to an event not supported by the BfxWebSocketClient.
Thrown when a user attempts to add a listener for an unknown event.
"""
class OutdatedClientVersion(BfxWebSocketException):