Resolves {fsm_name, fsm_version} to an FSM module.
Per-instance, not global: the engine supervisor owns a protected ETS table
(new/1 at boot) whose tid travels in the engine config, so separate engine
instances hold separate registries and there is no registry process at all.
Two resolution paths:
- Explicit registry — modules passed in
:fsmsare indexed by__gd_name__/0+__gd_version__/0in the table. Use this when a machine has a custom:name(thefsmcolumn is then not a module name) or to keep old:versions running: old instances finish on theirfsm_version, so the old module must stay registered. - Dynamic fallback — on a miss, the
fsmname is interpreted as a module name (its default isinspect(module)) and accepted if that module is aGenDurable.FSMwhose own name and version match the row. So a machine with the default name and a single version needs no:fsmsentry at all.
Reads are an ETS lookup plus, only on a miss, a cheap module check — no process call on the hot path.
Summary
Functions
Look up the module for {name, version} in table — the explicit registry
first, then a dynamic resolution of name as a module. Raises NotFound if
neither matches.
Create and seed the registry table from the :fsms modules. Owned by the
calling process (the engine supervisor), so it lives and dies with the
instance. Returns the table tid, carried in the engine config.
Functions
Look up the module for {name, version} in table — the explicit registry
first, then a dynamic resolution of name as a module. Raises NotFound if
neither matches.
Create and seed the registry table from the :fsms modules. Owned by the
calling process (the engine supervisor), so it lives and dies with the
instance. Returns the table tid, carried in the engine config.