Examples of subscription management with WebSocket connections.
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.