ExMCP.Content.ValidatorRegistry (ex_mcp v0.10.0)
View SourceGenServer-based validator registry that replaces Process dictionary usage.
This module provides a thread-safe registry for content validators that eliminates the concurrency issues with Process.put/2.
Summary
Functions
Returns a specification to start this module under a supervisor.
Gets a registered validator function.
Lists all registered validators.
Registers a validator function.
Starts the validator registry.
Unregisters a validator.
Checks if a validator is registered.
Types
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec get_validator(GenServer.server(), validator_name()) :: {:ok, validator_function()} | {:error, :not_found}
Gets a registered validator function.
@spec list_validators(GenServer.server()) :: [validator_name()]
Lists all registered validators.
@spec register_validator(GenServer.server(), validator_name(), validator_function()) :: :ok
Registers a validator function.
@spec start_link(keyword()) :: GenServer.on_start()
Starts the validator registry.
@spec unregister_validator(GenServer.server(), validator_name()) :: :ok
Unregisters a validator.
@spec validator_registered?(GenServer.server(), validator_name()) :: boolean()
Checks if a validator is registered.