INNER CODE UNIT · Python
_registry_state_map
ministackorg/ministack · ministack/app.py:460
def _registry_state_map():
"""Map persistence-file keys to modules declared by ``SERVICE_REGISTRY``.
A primary module normally uses its module name for the filename. Lambda
retains its long-standing ``lambda.json`` filename through ``state_key``;
sub-modules always use their own names.
"""
state_map = {}
for config in SERVICE_REGISTRY.values():
module = config["module"]
state_map[config.get("state_key", module)] = module
state_map.update({sub_module: sub_module for sub_module in config.get("sub_modules", ())})
return state_map
# Maps on-disk persistence keys to service modules. The registry is the sole
# declaration point, including modules reached through a service's dispatcher.
_state_map = _registry_state_map()