ADK.Plugin.Registry (ADK v0.0.1-alpha.1)

Copy Markdown View Source

Agent-based registry for global plugins.

Stores initialized {module, state} tuples. Start as part of your application supervision tree or manually with start_link/1.

Summary

Functions

Returns a specification to start this module under a supervisor.

Clear all registered plugins.

List all registered plugins as [{module, state}].

Register a plugin. Accepts a module or {module, config}.

Start the plugin registry.

Functions

child_spec(arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

clear()

@spec clear() :: :ok

Clear all registered plugins.

list()

@spec list() :: [{module(), term()}]

List all registered plugins as [{module, state}].

register(plugin)

@spec register(module() | {module(), term()}) :: :ok

Register a plugin. Accepts a module or {module, config}.

Calls init/1 on the module if implemented, otherwise uses config as state.

start_link(opts \\ [])

@spec start_link(keyword()) :: Agent.on_start()

Start the plugin registry.