Synapse.Signal.Registry (Synapse v0.1.1)
View SourceRuntime registry for signal topics and their schemas.
Topics can be declared via application configuration or registered at runtime. An ETS backend provides fast concurrent reads while validations run inside the GenServer process.
Summary
Functions
Returns a specification to start this module under a supervisor.
Retrieves the stored configuration for a topic.
Lists all registered topics.
Registers a new topic backed by the provided config.
Starts the registry.
Resolves a wire-format type to the registered topic.
Resolves a topic atom to its wire-format type.
Unregisters a topic.
Validates a payload against the topic schema and returns the normalized map.
Types
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec get_topic(atom() | pid(), topic()) :: {:ok, topic_config()} | {:error, term()}
Retrieves the stored configuration for a topic.
Lists all registered topics.
Registers a new topic backed by the provided config.
@spec start_link(keyword()) :: GenServer.on_start()
Starts the registry.
Options:
:name- Registry name (defaults toSynapse.Signal.Registry):topics- Topics to preload instead of application config:domains- Domains to auto-register during startup (defaults to config :synapse, :domains)
Resolves a wire-format type to the registered topic.
Resolves a topic atom to its wire-format type.
Unregisters a topic.
Validates a payload against the topic schema and returns the normalized map.
Raises KeyError for unknown topics and ArgumentError on validation errors.