Boot-time registration of running networks, so introspection tools can enumerate them in O(1) without scanning the supervision tree.
Each compiled network supervisor calls register/2 from its init/1. The
entry lives in Bloccs.NetworkRegistry keyed by the network id and is owned by
the supervisor process, so it is removed automatically when that supervisor
stops or crashes — list/0 never reports a dead network.
A network compiled with an older bloccs won't carry the registration call; re-run
mix bloccs.compileafter upgrading to make it discoverable.
Summary
Functions
List every running network.
Look up a single running network by id.
Register a running network. Called from the generated supervisor's init/1,
so the registration is owned by (and cleaned up with) the supervisor process.
Idempotent for the calling process.
Types
Functions
@spec list() :: [entry()]
List every running network.
Look up a single running network by id.
Register a running network. Called from the generated supervisor's init/1,
so the registration is owned by (and cleaned up with) the supervisor process.
Idempotent for the calling process.