macula_advertisement_manager (macula v0.20.5)

View Source

Advertisement manager GenServer - manages DHT service advertisements.

Responsibilities: - Advertise services in DHT with periodic re-advertisement - Unadvertise services and cancel timers - Register handlers with local gateway - Manage service advertisement lifecycle - Periodic cleanup of expired local services (every 60s, TTL 300s default)

Extracted from macula_connection.erl (Phase 6)

Summary

Functions

get_active_advertisements(Pid)

-spec get_active_advertisements(pid()) -> {ok, [binary()]}.

Get list of actively advertised services

handle_call(Request, From, State)

handle_cast(Msg, State)

handle_info(Info, State)

Handle re-advertisement timer

init(Opts)

start_link(Opts)

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

terminate(Reason, State)

unadvertise_service(Pid, Procedure)

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

Stop advertising a service