ExCEP.Gateway.ReconnectWorker (ex_cep v0.1.1)

Copy Markdown

Supervisor-friendly auto-reconnecting CEP Gateway client worker with exponential backoff.

Modeled after ExIEC61850.IEC61850.Client.ReconnectWorker. Manages an underlying ExCEP.Gateway.Client, automatically reconnects on initial failure or passive disconnect, and invokes :on_connected after every successful (re)connection.

Summary

Functions

Returns a specification to start this module under a supervisor.

Returns true if the worker is currently connected.

Returns the underlying ExCEP.Gateway.Client pid.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

connected?(worker)

@spec connected?(GenServer.server()) :: boolean()

Returns true if the worker is currently connected.

get_client(worker)

@spec get_client(GenServer.server()) :: pid()

Returns the underlying ExCEP.Gateway.Client pid.

start_link(opts)

@spec start_link(keyword()) :: GenServer.on_start()