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

Subscription and Websocket multiplexing #1764

Open
gbjk opened this issue Dec 26, 2024 · 1 comment
Open

Subscription and Websocket multiplexing #1764

gbjk opened this issue Dec 26, 2024 · 1 comment
Assignees

Comments

@gbjk
Copy link
Collaborator

gbjk commented Dec 26, 2024

Overview

Now that subscription configuration is nearly universal, we can start to address abstracting the solution, and learning from the issues with multiplexing subscriptions.

Required features:

  • Support connections per asset class
  • Support runtime subscriptions, including FlushChannels
  • Enabling pairs after subscription must work
  • Support N+ connections due to subscription cap or rate-limiting
  • Exchange base functions like SubscribeToWebsocketChannels need to work for both types of exchanges

Design

  • Remove Subscriptions and GenerateSubs from belonging to connections
    The most pressing reason for that is that in a world where we might establish N+ connections due to connection rate limiting,
    We can't possible generate the right subscriptions and (in the darkness) bind them at the connection level.
    I believe Subscriptions must be an exchange level entity, which are then allocated to websockets in a one-to-one relationship.
  • Router middleware to map connections and subscriptions
  • Just-in-time connections after the first connection
  • Separate Subscription configuration from runtime subscriptions
    • So that "All pairs" continues to work with FlushChannels
    • So we can always re-derive the store from the fanned out subscriptions
  • Unify the does/doesn't nature of multi-connection websockets. Everything should just be the same

References

@gbjk
Copy link
Collaborator Author

gbjk commented Jan 24, 2025

Requirement added from #1785

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress
Development

No branches or pull requests

1 participant