Raxol.Core.GlobalRegistry (Raxol v2.0.1)

View Source

Unified registry interface consolidating different registry patterns across Raxol.

This module provides a single interface for:

  • Terminal session registry
  • Plugin registry
  • Component registry
  • Theme/palette registry
  • Command registry

Usage

Terminal Sessions

UnifiedRegistry.register(:sessions, session_id, session_data)
sessions = UnifiedRegistry.list(:sessions)

Plugins

UnifiedRegistry.register(:plugins, plugin_id, plugin_metadata)
plugins = UnifiedRegistry.list(:plugins)

Commands

UnifiedRegistry.register(:commands, command_name, command_handler)
commands = UnifiedRegistry.search(:commands, pattern)

Summary

Functions

Bulk operations for efficiency.

Returns a specification to start this module under a supervisor.

Counts entries in the specified registry.

Filters entries by a custom function.

Lists all entries in the specified registry.

Looks up an entry in the specified registry.

Registers an entry in the specified registry.

Plugin registry operations.

Session registry operations.

Searches for entries matching a pattern in the specified registry.

Gets registry statistics.

Unregisters an entry from the specified registry.

Types

entry_data()

@type entry_data() :: any()

entry_id()

@type entry_id() :: String.t() | atom()

registry_type()

@type registry_type() :: :sessions | :plugins | :commands | :themes | :components

Functions

bulk_register(type, entries)

Bulk operations for efficiency.

bulk_unregister(type, ids)

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

count(type)

Counts entries in the specified registry.

filter(type, filter_fn)

Filters entries by a custom function.

handle_manager_cast(msg, state)

Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_cast/2.

handle_manager_info(msg, state)

Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_info/2.

list(type)

Lists all entries in the specified registry.

list_commands()

list_plugins()

list_sessions()

lookup(type, id)

Looks up an entry in the specified registry.

lookup_command(command_name)

lookup_plugin(plugin_id)

lookup_session(session_id)

register(type, id, data)

Registers an entry in the specified registry.

register_command(command_name, command_handler)

Command registry operations.

register_plugin(plugin_id, plugin_metadata)

Plugin registry operations.

register_session(session_id, session_data)

Session registry operations.

search(type, pattern)

Searches for entries matching a pattern in the specified registry.

search_commands(pattern)

start_link(init_opts \\ [])

stats()

Gets registry statistics.

unregister(type, id)

Unregisters an entry from the specified registry.

unregister_command(command_name)

unregister_plugin(plugin_id)

unregister_session(session_id)