handler_factory
Factory for registering and instantiating Merlin worker handler implementations.
This module defines the WorkerHandlerFactory, which manages the lifecycle and registration
of supported task server worker handlers (e.g., Celery). It extends MerlinBaseFactory to
provide a pluggable architecture for loading handlers via entry points or direct registration.
The factory enforces type safety by validating that all registered components inherit from
MerlinWorkerHandler. It also provides aliasing support and a standard mechanism for plugin
discovery and instantiation.
WorkerHandlerFactory
Bases: MerlinBaseFactory
Factory class for managing and instantiating supported Merlin worker handlers.
This subclass of MerlinBaseFactory handles registration, validation,
and instantiation of worker handlers (e.g., Celery, Kafka).
Attributes:
| Name | Type | Description |
|---|---|---|
_registry |
Dict[str, MerlinWorkerHandler]
|
Maps canonical handler names to handler classes. |
_aliases |
Dict[str, str]
|
Maps legacy or alternate names to canonical handler names. |
Methods:
| Name | Description |
|---|---|
register |
Register a new handler class and optional aliases. |
list_available |
Return a list of supported handler names. |
create |
Instantiate a handler class by name or alias. |
get_component_info |
Return metadata about a registered handler. |