Supervisor-friendly auto-reconnecting IEC 61850 client worker with exponential backoff.
Manages an underlying IedConnection, automatically reconnects on initial failure or
passive disconnect, and invokes :on_connected after every successful (re)connection
so callers can re-enable BRCB/URCB subscriptions.
Example
{:ok, worker} =
ExIEC61850.IEC61850.Client.ReconnectWorker.start_link(
host: "127.0.0.1",
port: 102,
initial_backoff_ms: 500,
max_backoff_ms: 10_000,
on_connected: fn conn -> IedConnection.get_logical_device_list(conn) end
)
Summary
Functions
Returns a specification to start this module under a supervisor.
Returns true if the worker is currently connected to the IED server.
Returns the underlying IedConnection pid.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec connected?(GenServer.server()) :: boolean()
Returns true if the worker is currently connected to the IED server.
@spec get_connection(GenServer.server()) :: pid()
Returns the underlying IedConnection pid.
@spec start_link(keyword()) :: GenServer.on_start()