Modules
A robust WebSocket client library for Elixir, built on Gun transport.
WebSocket client GenServer using Gun as transport layer.
Process-down-safe GenServer.call helpers used by ZenWebsocket.Client.
handle_call/3 and handle_info/2 clause bodies for ZenWebsocket.Client.
Gun connection open, upgrade, and cleanup for ZenWebsocket.Client.
JSON-RPC response and timeout correlation for ZenWebsocket.Client.
Inbound WebSocket frame routing for ZenWebsocket.Client.
Explicit reconnect target and option handling for ZenWebsocket.Client.
Session recorder lifecycle and frame writes for ZenWebsocket.Client.
Connection-error retry state machine for ZenWebsocket.Client.
Pure retry eligibility and error normalization for ZenWebsocket.Client.
Gun error/down logging and retry dispatch for ZenWebsocket.Client.
Optional supervisor for WebSocket client connections.
Configuration struct for WebSocket connections.
Opt-in ETS connection tracking, without a GenServer.
Conditional debug logging for ZenWebsocket.
Simple error handling for WebSocket connections.
Supervisor for WebSocket adapters with fault tolerance.
Simple batch subscription manager for efficiently subscribing to multiple channels.
Simplified Deribit WebSocket API adapter.
Production-ready supervised Deribit adapter with automatic reconnection.
Shared Deribit JSON-RPC method definitions and request builders.
Minimal connect-send-receive flows against a live endpoint.
A GenServer that owns a connection and retries it with backoff.
JSON-RPC 2.0 calls over a WebSocket connection.
Channel subscription flows over a WebSocket connection.
Shared JSON-RPC send helper used by Deribit example adapters.
Minimal template for creating platform-specific WebSocket adapters.
Basic WebSocket client supervision example.
Examples of different WebSocket client usage patterns. This module demonstrates three ways to use ZenWebsocket
Example application module demonstrating all WebSocket connection patterns.
WebSocket frame encoding and decoding utilities.
Records application-level heartbeat pongs and emits interval telemetry.
Manages heartbeat lifecycle for WebSocket connections.
Helper functions for Deribit-specific WebSocket operations.
JSON-RPC 2.0 request builder and response matcher.
Bounded circular buffer for latency statistics calculation.
Message handling utilities for WebSocket connections.
Health-based connection routing for WebSocket client pools.
Token bucket rate limiter for WebSocket API calls.
Internal reconnection helper for Client GenServer.
Pure functions for WebSocket session recording and replay.
Async GenServer for recording WebSocket sessions to JSONL files.
Manages request/response correlation for JSON-RPC WebSocket connections.
Invokes user-provided lifecycle callbacks without letting them crash the caller.
Tracks Deribit-dialect JSON-RPC subscriptions for reconnect restoration.
Test helpers for consumers testing ZenWebsocket integrations.
Mix Tasks
Mix task to export ZenWebsocket usage rules for AI agents and developers.
Validates that code follows ZenWebsocket usage rules.