Bingex.Socket behaviour (Bingex v0.1.7)
Provides an abstraction over WebSocket connections for BingX.
This module builds on WebSockex
, handling connection management, message passing,
and event dispatching while hiding implementation details. It allows consumers to define
their own event handlers through callback functions.
Key features:
- Automatic handling of WebSocket connections, including reconnections.
- Message passing using
call/3
,cast/2
, andsend/2
. - Support for compressed binary frames (e.g., handling gzip-compressed data).
- Flexible event handling via callback functions.
This module is designed to simplify WebSocket integration while allowing customization through user-defined modules.
Summary
Functions
Sends a synchronous message.
Sends an asynchronous message.
Sends a message to the process to the specified PID.
Starts a WebSocket process.
Starts a WebSocket process linked to the current process.
Returns the pid
of a Socket process, nil
otherwise.
Types
Callbacks
@callback handle_disconnect( details :: WebSockex.connection_status_map(), state() ) :: {:stop, state()} | {:reconnect, state()}
Functions
Sends a synchronous message.
Sends an asynchronous message.
Sends a message to the process to the specified PID.
Starts a WebSocket process.
Starts a WebSocket process linked to the current process.
Returns the pid
of a Socket process, nil
otherwise.