MqttX.Client.Supervisor (MqttX v0.7.0)
View SourceDynamicSupervisor for managing client connection lifecycles.
Provides supervised client connections with automatic restart on crash.
Use MqttX.Client.connect_supervised/1 to start connections under this supervisor.
Example
{:ok, pid} = MqttX.Client.connect_supervised(
host: "localhost",
port: 1883,
client_id: "my_client"
)
# List all supervised connections
MqttX.Client.list()
# Look up by client_id
MqttX.Client.whereis("my_client")
Summary
Functions
Returns a specification to start this module under a supervisor.
Count supervised connections.
Start a supervised client connection.
Stop a supervised client connection.
List supervised connections.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec count() :: map()
Count supervised connections.
@spec start_child(keyword()) :: DynamicSupervisor.on_start_child()
Start a supervised client connection.
@spec stop_child(pid()) :: :ok | {:error, :not_found}
Stop a supervised client connection.
List supervised connections.