ConvergeLedger.Discovery (Converge Ledger v0.1.2)

View Source

Handles service discovery and grouping using Erlang's pg (Process Groups).

Allows processes to:

  • Register as serving a specific context ("domain").
  • Discover other nodes/processes serving that context.
  • Broadcast messages to the group.

Summary

Functions

Broadcasts a message to all members serving context_id (including self).

Registers the current process as a member of the group serving context_id.

Leaves the group serving context_id.

Returns a list of local PIDs serving context_id.

Returns a list of PIDs serving context_id across the cluster.

Functions

broadcast(context_id, message)

Broadcasts a message to all members serving context_id (including self).

join(context_id)

Registers the current process as a member of the group serving context_id.

leave(context_id)

Leaves the group serving context_id.

local_members(context_id)

Returns a list of local PIDs serving context_id.

members(context_id)

Returns a list of PIDs serving context_id across the cluster.