API Reference WebsockexNova v#0.1.1
View SourceModules
WebsockexNova is a robust WebSocket client library for Elixir with a pluggable adapter architecture.
Macro for building WebsockexNova adapters with minimal boilerplate.
Manages authentication flows for WebSocket connections.
Defines a behavior for handling WebSocket authentication flows.
Behavior defining the contract for WebSocket client operations.
Behaviour for handling WebSocket connection lifecycle events.
Behaviour for error handlers.
Defines the behavior for standardized, configurable logging in WebsockexNova.
Defines the behavior for handling WebSocket messages.
Behaviour for metrics collectors. All state and context are maps. All arguments and return values are explicit and documented. Supports both stateless (3-arity, for telemetry) and stateful (4-arity, for handler API) callbacks.
Behaviour for rate limit handlers. All state is a map. All arguments and return values are explicit and documented.
Behaviour for managing WebSocket channel subscriptions and topics.
Main client API for WebsockexNova WebSocket connections.
Utility functions for registering various handler behaviors with WebsockexNova connections.
Canonical state for a WebSocket client connection. All core application/session state is explicit and top-level. Handler/feature-specific state is namespaced in maps (e.g., :rate_limit, :logging, :metrics). Adapter-specific state is kept in :adapter_state. :extras is for extensibility.
Macro for building WebsockexNova client modules with minimal boilerplate.
State struct for WebsockexNova.Connection GenServer. Encapsulates all data required for robust Gun/WebSocket lifecycle management, buffering, request/response correlation, and handler module integration.
Registry for WebSocket connection information.
Default implementation of the AuthHandler behavior.
Default implementation of the ConnectionHandler behavior.
Default implementation of the ErrorHandler behavior.
Default implementation of the LoggingHandler behavior for WebsockexNova.
Default implementation of the MessageHandler behavior.
Default implementation of the MetricsCollector behavior for WebsockexNova.
Default implementation of the RateLimitHandler behavior. This module now stores all rate limit state in the canonical WebsockexNova.ClientConn struct, under the :rate_limit field.
Default implementation of the SubscriptionHandler behavior.
Example Deribit adapter using use WebsockexNova.Adapter
macro.
Example adapter demonstrating subscription preservation across reconnections.
Deribit-specific client API, wrapping WebsockexNova.Client with the Deribit adapter.
Deribit-specific client API using the ClientMacro.
Connects Gun events to WebsockexNova behavior callbacks.
Manages the WebSocket connection lifecycle using a state machine approach.
Centralized parsing and validation for Gun connection options.
State structure for ConnectionWrapper.
A thin adapter over Gun's WebSocket implementation, providing a standardized API.
Standardized error handling for the Gun ConnectionWrapper.
Handles Gun message processing for the ConnectionWrapper.
Handles encoding and decoding of WebSocket frames.
Handler for WebSocket binary frames.
Handler for WebSocket control frames (ping, pong, close).
Behavior defining how to handle different types of WebSocket frames.
Handler for WebSocket text frames.
Helper functions for calling behavior callbacks consistently.
Helper functions for consistent state operations across the codebase.
Helpers for synchronizing state between ClientConn and ConnectionState.
Provides detailed tracing capabilities for connection state transitions.
Centralized dispatcher for handler module invocation.
Helper functions for working with application state.
Manages WebSocket subscriptions with support for persistence and automatic resubscription.
A simple mock implementation of the WebsockexNova.Transport behaviour for testing and development.
Central registry and documentation for all telemetry events emitted by WebsockexNova.
Behaviour for pluggable WebSocket transport layers in WebsockexNova.
Provides rate limiting functionality for WebSocket requests.
Provides various reconnection strategies for WebSocket connections.
Implements an exponential backoff reconnection strategy.
Implements a linear backoff with jitter reconnection strategy.
Implements a constant delay reconnection strategy.
Mix Tasks
Checks all WebsockexNova.Defaults.* handler modules to ensure they implement all required callbacks for their respective behaviors. Prints missing callbacks or confirms all are correct.