pyqt_reactive.protocols.function_registry

Function registry protocol for pluggable function lookup.

Allows applications to provide their own function registry implementation without pyqt-reactor depending on specific function registry implementations.

Functions

get_function_registry()

Get the registered function registry.

register_function_registry(registry)

Register a function registry implementation.

Classes

FunctionRegistryProtocol(*args, **kwargs)

Protocol for function registries that provide function lookup and metadata.

class pyqt_reactive.protocols.function_registry.FunctionRegistryProtocol(*args, **kwargs)[source]

Protocol for function registries that provide function lookup and metadata.

Applications can implement this protocol to provide their own function registry.

Example

from pyqt_reactive.protocols import register_function_registry from myapp.registry import MyFunctionRegistry

register_function_registry(MyFunctionRegistry())

get_function_by_name(name: str) Callable | None[source]

Get function by name.

Parameters:

name – Function name to lookup

Returns:

Function callable if found, None otherwise

get_all_functions() Dict[str, Callable][source]

Get all registered functions.

Returns:

Dictionary mapping function names to callables

get_function_metadata(name: str) Dict[str, Any] | None[source]

Get metadata for a function.

Parameters:

name – Function name

Returns:

Metadata dict if available, None otherwise

__init__(*args, **kwargs)
pyqt_reactive.protocols.function_registry.register_function_registry(registry: FunctionRegistryProtocol) None[source]

Register a function registry implementation.

Parameters:

registry – Object implementing FunctionRegistryProtocol

pyqt_reactive.protocols.function_registry.get_function_registry() FunctionRegistryProtocol | None[source]

Get the registered function registry.

Returns:

Registered registry or None if not registered