Search documentation of macula

# macula_gateway_workers_sup (macula v0.44.2)

View Source

Gateway Workers Supervisor - supervises gateway worker processes.

Supervision Strategy: - rest_for_one: If child N crashes, restart N and all children after N - Rationale: Only clients is foundational; pubsub/rpc/mesh depend on it but are independent of each other. This strategy provides fault isolation while maintaining consistency when clients restarts.

Children (in dependency order): - macula_gateway_clients: Client tracking (foundational) - macula_gateway_pubsub: Pub/Sub message routing (depends on clients) - macula_gateway_rpc: RPC handler registration and routing (depends on clients) - macula_gateway_mesh: Mesh connection pooling and management (independent)

Fault Isolation Examples: - mesh crash → only mesh restarts (0 clients disconnected) - rpc crash → rpc + mesh restart (0 clients disconnected) - pubsub crash → pubsub + rpc + mesh restart (0 clients disconnected) - clients crash → all restart (unavoidable - foundational)

Extracted from macula_gateway.erl (Phase 6, 9) Renamed from macula_gateway_sup (Phase 2 QUIC refactoring)

# Summary

## Functions

get_clients(SupPid)

Get the clients worker child PID.

get_mesh(SupPid)

Get the mesh connection manager child PID.

get_pubsub(SupPid)

Get the pubsub handler child PID.

get_rpc(SupPid)

Get the RPC handler child PID.

init(Config)
start_link(Config)

Start the gateway supervisor with configuration.

# Functions

# get_clients(SupPid)

    -spec get_clients(pid()) -> {ok, pid()} | {error, not_found}.

Get the clients worker child PID.

# get_mesh(SupPid)

    -spec get_mesh(pid()) -> {ok, pid()} | {error, not_found}.

Get the mesh connection manager child PID.

# get_pubsub(SupPid)

    -spec get_pubsub(pid()) -> {ok, pid()} | {error, not_found}.

Get the pubsub handler child PID.

# get_rpc(SupPid)

    -spec get_rpc(pid()) -> {ok, pid()} | {error, not_found}.

Get the RPC handler child PID.

# init(Config)

# start_link(Config)

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

Start the gateway supervisor with configuration.