mcl_core_info (mcl_core v1.0.0)

View Source

<org>/info: who this service is, answered on every mcl_core node with no code in the service.

The realm's Providers desk counts a node online only while it has an unexpired procedure advertisement signed by it, so a service that only publishes (the mpong bots) advertised nothing and always showed offline, even while it worked. mcl_core:boot/2 adds this capability to every service's own, through the same delegation path as the rest: it appears once the org is admitted.

OPEN AND CHEAP. Any mesh caller may ask; the request takes no arguments and the reply is a handful of public facts. The health word comes from the verdict mcl_core_health last computed, never a fresh probe per call, so a flood of calls cannot turn into a flood of the service's own health checks. No environment, paths, keys, grants or failure reasons are ever included.

A service cannot switch it off, and may not declare its own info.

Summary

Functions

The handler: the payload is ignored, since info takes no arguments.

The handler of the hosted service ServiceMod (mcl-om#8): its own name, org, health and the procedures of its org.

The capability mcl_core advertises for every service.

The info capability of the hosted service ServiceMod: its handler answers for that service, so each org on a node hosting several answers with its own (mcl-om#8).

The reply, from the facts: every string as {text, _} so a non-BEAM caller reads text rather than bytes, numbers as numbers, no booleans.

A service's capabilities with info added. A service that declares its own info is refused: the name is mcl_core's, on every node.

Functions

answer(Payload)

-spec answer(term()) -> map().

The handler: the payload is ignored, since info takes no arguments.

answer(Payload, ServiceMod)

-spec answer(term(), module()) -> map().

The handler of the hosted service ServiceMod (mcl-om#8): its own name, org, health and the procedures of its org.

capability()

-spec capability() -> mcl_core_service:capability().

The capability mcl_core advertises for every service.

capability(ServiceMod)

-spec capability(module() | undefined) -> mcl_core_service:capability().

The info capability of the hosted service ServiceMod: its handler answers for that service, so each org on a node hosting several answers with its own (mcl-om#8).

render(Facts)

-spec render(map()) -> map().

The reply, from the facts: every string as {text, _} so a non-BEAM caller reads text rather than bytes, numbers as numbers, no booleans.

with_info(Caps)

A service's capabilities with info added. A service that declares its own info is refused: the name is mcl_core's, on every node.

with_info(ServiceMod, Caps)