Skip to main content

Module sync

Module sync 

Source
Expand description

SRV-005 R5/R6: cross-node subscription propagation and message fan-out.

Each channel maps to a beamr process group (the channel name interned into an atom in the default pg scope). A local subscriber joining a channel joins that pg group; beamr broadcasts the membership to connected peers, so every node knows which peers hold subscribers for which channel. Publishing then consults the group’s REMOTE members and forwards the published envelope to each one over the existing distribution link.

  • R5 propagation: ClusterSync::on_subscribe -> pg.join; the broadcast is beamr’s, not ours.
  • R5 backfill: a fresh pg.join only broadcasts on the insert edge, so a peer that joins the cluster AFTER our subscribers registered would never learn them. ClusterSync::on_peer_join re-sends a pg-join control frame for each of our local members directly to the newcomer.
  • R5 delivery: ClusterSync::on_publish sends the envelope (encoded by liminal::channel::encode_envelope) as a beamr SEND to each remote member’s pid. On that member’s home node the frame lands in the subscriber process’s mailbox, which decodes it back into its inbox.
  • R6 cleanup: when a peer drops, beamr’s connection-down hook calls purge_remote_node, so its remote members vanish from every group with no liminal code on the path. ClusterSync::on_peer_leave only logs.

Structs§

ClusterSync
Propagates channel subscriptions and fans published messages out across the cluster via beamr process groups (SRV-005 R5/R6).