API Reference ZenWebsocket v#0.5.0

Copy Markdown View Source

Modules

A robust WebSocket client library for Elixir, built on Gun transport.

WebSocket client GenServer using Gun as transport layer.

Optional supervisor for WebSocket client connections.

Configuration struct for WebSocket connections.

ETS-based connection tracking without 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.

Basic usage examples from the documentation. These examples demonstrate simple WebSocket connections and message handling.

Error handling and retry patterns from Examples.md

JSON-RPC client example from documentation.

Examples of subscription management with WebSocket connections.

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.

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.

Manages subscription tracking for WebSocket connections.

Test helpers for consumers testing ZenWebsocket integrations.

Mix Tasks

Runs stability tests for ZenWebsocket with Deribit integration.

Mix task to export ZenWebsocket usage rules for AI agents and developers.

Validates that code follows ZenWebsocket usage rules.