Channel subscription flows over a WebSocket connection.
Sends multi-channel subscribe payloads with Client.send_message/2 and consumes the
resulting {:websocket_message, _} frames the default handler forwards to the
calling process, both one at a time and in a collect-N loop.
Summary
Functions
Process market data updates with pattern matching.
Subscribe to multiple data streams using echo server.
Subscribe and process messages in a loop.
Functions
@spec handle_market_data(timeout()) :: {:market_update, String.t(), term()} | {:message, map()} | {:text_message, String.t()} | {:closed, term()} | {:error, :timeout}
Process market data updates with pattern matching.
@spec multi_channel_subscription() :: {:ok, ZenWebsocket.Client.t(), [String.t()]}
Subscribe to multiple data streams using echo server.
@spec subscription_loop(ZenWebsocket.Client.t(), [String.t()], non_neg_integer()) :: {:ok, [term()]} | {:error, :timeout, [term()]}
Subscribe and process messages in a loop.