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

What is the benefit of having two channels for main and secondary for WS? #346

Closed
FreerGit opened this issue Oct 16, 2022 · 1 comment
Closed

Comments

@FreerGit
Copy link

As title states, trying to understand why websocket has two different channels (/core/src/connectivity/websocket.rs)

pub struct WsSender {
    /// Main websocket connection sender
    main_sender: mpsc::UnboundedSender<Message>,
    /// Secondary websocket connection sender
    secondary_sender: Option<mpsc::UnboundedSender<Message>>,
    /// Cancellation token for service futures
    _cancel: CancellationTokenDropGuard,
}

Is one for hotpath data such as trades/orderbook updates and the secondary one for intra service communication, trigger callback etc?

@siberianguy
Copy link
Contributor

Some exchanges (i. e. Binance) have separate Web Socket endpoints for private and public notifications

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

No branches or pull requests

2 participants