DistLink
DistLink: cross-node process monitors and bidirectional links (P5c).
Monitor protocol (two-step):
- Local: call monitor(target_pid, timeout_ms) → sends MONITOR_REQ to
the node that hosts target_pid, returns Ok(MonitorRef).
2. Remote node: receives MONITOR_REQ, calls march_dist_monitor_register
in its C runtime. On actor exit it sends MONITOR_FIRE back.
3. Local net-kernel loop: receives MONITOR_FIRE, delivers
Down(ref, pid, reason) to the watcher's mailbox.Node-down: when the peer connection drops (PeerDown from SwimDriver), the DistLink actor sweeps its pending_monitors table and fires Down(NodeDown) locally to all watchers of targets on that node.
Links build on monitors: both sides call monitor on each other. A Down message triggers EXIT propagation in the linked process (unless trapping).
Down reason: Normal | Killed | Crash(String) | NodeDown
MonitorRef is an opaque integer; demonitor(ref) cancels the monitor.
Types
Functions
fnfind_by_target_pidfind_by_target_pid(tbl : MonitorTable, target_pid : Int) : Option(PendingMonitor)#