ExCEP.Supervisor (ex_cep v0.1.1)

Copy Markdown

OTP Supervisor helper for embedding ExCEP Cluster servers and/or auto-reconnecting Edge Gateway clients into a host application's supervision tree.

Example (Dual-Channel Cluster Server)

children = [
  {ExCEP.Supervisor,
   name: MyApp.CEPSupervisor,
   servers: [
     [channel: :management, port: 9901, name: :cep_mgmt, signer: cluster_signer],
     [channel: :business, port: 9902, name: :cep_biz, signer: cluster_signer]
   ]}
]

Example (Auto-Reconnecting Dual-Channel Edge Gateway)

children = [
  {ExCEP.Supervisor,
   name: MyGateway.CEPSupervisor,
   reconnect_clients: [
     [host: "10.0.0.1", port: 9901, channel: :management, gateway_id: "GW-01", name: :gw_mgmt, signer: gw_signer],
     [host: "10.0.0.1", port: 9902, channel: :business, gateway_id: "GW-01", name: :gw_biz, signer: gw_signer]
   ]}
]

Summary

Functions

Returns a specification to start this module under a supervisor.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts \\ [])

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