macula_rag_responder (macula_rag v0.4.0)
View SourceThis node's shard answering the org's queries.
Holds whether the node may provide the org's procedure and advertises it once it may. macula only lets a node provide an org's procedure when the org's D25 delegation names it (macula:provider_authorization/3). The responder asks at registration and, while refused, again every grant_retry_ms, so a delegation made after the service started is picked up: it advertises then, once. After that it asks nothing: macula replays the advertisement itself when a link respawns.
The callback runs in the process macula calls handle/1 in, not in this server, so one slow query holds up no other. It is kept in persistent_term, written only when a responder registers or unregisters.
Summary
Functions
This node's own shard answering this node's query: the same answer a peer would get, through the same codec, so hits read alike whichever shard they came from.
The procedure's handler: what macula calls with a query from another shard. Returns this shard's answer, or {error, Reason}, which macula sends back as the call's error.
Called by macula_rag:configure/3: a registered responder asks for its grant again under the new configuration.
Functions
This node's own shard answering this node's query: the same answer a peer would get, through the same codec, so hits read alike whichever shard they came from.
The procedure's handler: what macula calls with a query from another shard. Returns this shard's answer, or {error, Reason}, which macula sends back as the call's error.
-spec rebind() -> ok.
Called by macula_rag:configure/3: a registered responder asks for its grant again under the new configuration.
-spec register(macula_rag:responder()) -> ok | {error, not_configured}.
-spec unregister() -> ok.