Module websocket

Module websocket 

Source
Expand description

HTX WebSocket API client implementation.

This module provides the WebSocketConnector and WebSocketConnection for interacting with the HTX WebSocket API. It enables real-time streaming of market data, such as ticker updates, and is used internally to implement the AssetInfoProvider trait for asset workers.

This module provides:

  • Establishes WebSocket connections to HTX servers
  • Subscribes and unsubscribes to ticker streams for specified symbols
  • Processes incoming WebSocket messages, including gzip-compressed binary messages
  • Transforms WebSocket messages into AssetInfo for use in workers
  • Handles connection management, including ping/pong keep-alive and graceful closing

Structsยง

WebSocketConnection
Represents an active WebSocket connection to the HTX API.
WebSocketConnector
A connector for establishing WebSocket connections to the HTX WebSocket API.