hecate_om_capabilities (hecate_om v0.3.1)

View Source

Publishes a service's capability list onto the realm's capability-announce channel AND subscribes to that channel to track every other service's announcements.

Two roles in one worker:

- Publisher: every register/1 or publish/0 call republishes this service's capability summary onto <<"_mesh.cap.announce">>. - Subscriber: at boot (and on every reconfigure), subscribes to the same topic; inbound summaries land in handle_info/2 and update the peer_caps map.

Other services / plugins call lookup/1 with a capability name (<<"hecate-rag.answer_query">>) and get back the list of services that advertised it. Caller uses that list to pick a target for macula:call/5.

Summary

Functions

Find services that advertised the given capability name. Returns {ok, [#{service := Bin, capabilities := [...], published_at := Ms}]}.

Functions

handle_call(Msg, From, S)

handle_cast(_, S)

handle_info(Other, State)

init(_)

list()

lookup(CapName)

-spec lookup(binary()) -> {ok, [map()]}.

Find services that advertised the given capability name. Returns {ok, [#{service := Bin, capabilities := [...], published_at := Ms}]}.

peers()

-spec peers() -> [map()].

publish()

register(Caps)

start_link()

terminate(_, _)