hyperliquid-dex / hyperliquid-rust-sdk

MIT License
57 stars 47 forks source link

Support for sending pings from ws manager #22

Closed sree-revoori1 closed 3 months ago

sree-revoori1 commented 5 months ago

Could we add functionality for sending pings from the websocket manager? I see a couple ways we can do this:

  1. Run an async background process that continuously sends pings every x seconds.
  2. Expose a function on the WsManager struct that sends a ping whenever it is called.

Given that 1 is what the hyperliquid-python-sdk does, it is probably the best option. To make this change non-intrusive and to not change the behavior of the WS manager for everyone, we can add this behind a feature flag.