Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebSocket multiple connections and API keys #860

Open
FrancisH-C opened this issue Mar 13, 2025 · 1 comment
Open

WebSocket multiple connections and API keys #860

FrancisH-C opened this issue Mar 13, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@FrancisH-C
Copy link

FrancisH-C commented Mar 13, 2025

Is your feature request related to a problem? Please describe.

Managing WebSocket disconnections when the connection limit is reached, beyond just First-In-First-Out.
e.g.

ws_usage1 = WebSocketClient(APIKey1)
ws_usage1.subscribe("A." <ticker>)
ws_usage2 = WebSocketClient(APIKey2)
ws_usage2.subscribe("A." <ticker>)
ws_usage3 = WebSocketClient(APIKey2)
ws_usage3.subscribe("A." <ticker>)
# ws_usage1 disconnects

Describe the solution you'd like
Solution1

Priority list instead of FIFO

priority = 1 # Higher priority, disconnect last
ws_usage1 = WebSocketClient(APIKey1, priority=priority)

Solution2

outputs from usage3.py
Exception("Connection refused: Maximum connection limit reached.")

Solution3

Disconnect according to the APIKey used not FIFO.

Describe alternatives you've considered
Looked into the APIKey configuration side of things (maybe I missed something)

Additional context

@FrancisH-C FrancisH-C added the enhancement New feature or request label Mar 13, 2025
@justinpolygon
Copy link
Contributor

Hey @FrancisH-C, I'm trying to learn a little more about what you're doing here. What is the reason for multiple websocket connections? For most accounts we only support 1 connection unless you request more. I'm just wanting to learn the use-case for multiple connections in 1 app and then the FIFO ordering needed. The background could help to see what's happening and maybe there is a bigger change needed. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants