mcl_core_lan_capability (mcl_core v1.0.0)

View Source

One capability served on the LAN (docs/DESIGN.md §2.2).

The process joins the pg group {capability, Org, Name}, so a call from any cluster node finds it. Each call it admits runs in a process of its own, as macula_response runs each mesh call: the handler's init/1, then handle_request/2 on the payload, behind the same guard pipeline the mesh path uses (mcl_core_guard_pipeline:wrapper/3). So a slow call does not hold up the next, and a crash ends only its own call.

THE CALLER. The calling node sends its node id with the call, and the payload's caller is set to it, over anything the payload carried, as macula sets it on the mesh. macula_response:caller/0 reads it too, for a payload that is not a map. It is a cluster member's own claim (design §2.4): no weaker than distributed Erlang, where a member can already run code here.

Summary

Functions

How long a call to Cap may run: its handler_timeout_ms, else macula_response's default. The bridge forwards a mesh call with the same budget (mcl-core#7).

Functions

handle_call(Request, From, State)

handle_cast(Msg, State)

handle_info(Msg, State)

handler_timeout_ms(Cap)

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

How long a call to Cap may run: its handler_timeout_ms, else macula_response's default. The bridge forwards a mesh call with the same budget (mcl-core#7).

init(_)

start_link(Org, Cap)