WebsockexAdapter.Examples.SupervisedClient (WebsockexAdapter v0.1.1)

View Source

Basic WebSocket client supervision example.

Shows minimal setup for supervised connections. For advanced patterns, see the supervision documentation.

Summary

Functions

Lists all supervised connections.

Starts a supervised WebSocket connection.

Starts multiple supervised connections.

Stops a supervised connection.

Functions

list_connections()

Lists all supervised connections.

start_connection(url, opts \\ [])

Starts a supervised WebSocket connection.

Example

{:ok, client} = SupervisedClient.start_connection("wss://echo.websocket.org")

start_multiple(configs)

Starts multiple supervised connections.

Example

clients = SupervisedClient.start_multiple([
  {"wss://api1.example.com", retry_count: 5},
  {"wss://api2.example.com", heartbeat_interval: 20_000}
])

stop_connection(client_pid)

Stops a supervised connection.