macula_dist_system (macula v9.1.1)

View Source

Macula Distribution System Supervisor.

This supervisor manages the distribution-over-mesh subsystem components:

- macula_dist_bridge_sup - Supervisor for relay tunnel bridges - macula_dist_discovery - Decentralized node discovery (replaces EPMD)

LAN cluster formation (gossip/static/libcluster strategy) is a separate concern — see macula_cluster_system — and is not started by this supervisor. Consumers that want LAN clustering start macula_cluster:start_cluster/1 (or the underlying strategy module) themselves.

The bridge supervisor hosts macula_dist_bridge gen_server children (one per relay tunnel). When macula_dist_system is not started (standalone relay mode), macula_dist_pool:advertise_dist_accept/0 starts the bridge supervisor on demand.

Configuration options (in sys.config): dist_port - QUIC port (default 4433) discovery_type - mdns, dht, or both

Summary

Functions

Dynamically start the dist_relay_client under this supervisor. Used by macula:join_dist_relay/1 when the relay URL is chosen at runtime rather than at application boot.

Start the distribution system supervisor with default options.

Start the distribution system supervisor with options.

Functions

start_dist_relay_client(Url, NodeName)

-spec start_dist_relay_client(binary() | string(), binary()) -> {ok, pid()} | {error, term()}.

Dynamically start the dist_relay_client under this supervisor. Used by macula:join_dist_relay/1 when the relay URL is chosen at runtime rather than at application boot.

start_link()

-spec start_link() -> {ok, pid()} | {error, term()}.

Start the distribution system supervisor with default options.

start_link(Opts)

-spec start_link(map()) -> {ok, pid()} | {error, term()}.

Start the distribution system supervisor with options.