Monty.Runtime.Registry (ExTbpMonty.Core v0.1.0)

Copy Markdown View Source

Names for module processes.

Every sensor and learning module registers a stable key ({:sensor_module, model_id, id}, {:learning_module, model_id, id}), and the coordinator addresses it with a :via tuple. A restart changes the pid but not the name, so nothing in the step loop has to be rewritten when a module dies. The model id in the key lets several runs share one registry without inventing an atom per run.

Summary

Functions

The processes registered under a key.

The application-wide registry module processes register in.

A :via name for a key.

Functions

lookup(key)

@spec lookup(term()) :: [{pid(), term()}]

The processes registered under a key.

registry()

@spec registry() :: atom()

The application-wide registry module processes register in.

via(key)

@spec via(term()) :: {:via, Registry, {atom(), term()}}

A :via name for a key.