macula_rag_directory (macula_rag v0.2.0)

View Source

What the org's shards hold: the summaries they publish, this node's own included.

Subscribes to the org's two shard facts and keeps the latest summary of each shard BY ITS VERIFIED PUBLISHER, the node id macula delivered the fact with, whatever the payload claims. A withdrawal removes it. A summary not republished within three republish periods is stale and treated as absent, so a shard that vanished stops being asked for it.

This node's own summary is published by advertise/2 and republished every summary_republish_ms, so a node that subscribes later still hears it. It is also kept here directly, under this node's own id, rather than waiting for the mesh to hand it back.

A summary is not trust: the shards a query asks are the procedure's providers, which macula checks against the org's delegations. A summary from a node that is no provider is never used.

Summary

Functions

Subscribe under the configuration in force, dropping any earlier subscription, and republish this node's summary if it has one.

Every shard with a live summary, node ids in lowercase hex.

A shard's live summary, by its node id: {ok, #{shard_id, embedding, topics, bloom, at_ms}}, or none.

Functions

advertise(Topics, Bloom)

-spec advertise([binary()], binary()) -> ok | {error, term()}.

advertised()

-spec advertised() -> boolean().

handle_call(_, From, St)

handle_cast(Msg, St)

handle_info(Stale, St)

init(_)

rebind()

-spec rebind() -> ok.

Subscribe under the configuration in force, dropping any earlier subscription, and republish this node's summary if it has one.

shards()

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

Every shard with a live summary, node ids in lowercase hex.

start_link()

summary(Node)

-spec summary(binary()) -> {ok, map()} | none.

A shard's live summary, by its node id: {ok, #{shard_id, embedding, topics, bloom, at_ms}}, or none.

withdraw()

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