worker_factory
Factory for registering and instantiating individual Merlin worker implementations.
This module defines the WorkerFactory, a subclass of
MerlinBaseFactory, which manages
the registration, validation, and creation of concrete worker classes such as
CeleryWorker. It supports plugin-based discovery
via Python entry points, enabling extensibility for other task server backends (e.g., Kafka).
The factory ensures that all registered components conform to the MerlinWorker interface
and provides useful utilities such as aliasing and error handling for unsupported components.
WorkerFactory
Bases: MerlinBaseFactory
Factory class for managing and instantiating supported Merlin workers.
This subclass of MerlinBaseFactory handles registration, validation,
and instantiation of workers (e.g., Celery, Kafka).
Attributes:
| Name | Type | Description |
|---|---|---|
_registry |
Dict[str, MerlinWorker]
|
Maps canonical worker names to worker classes. |
_aliases |
Dict[str, str]
|
Maps legacy or alternate names to canonical worker names. |
Methods:
| Name | Description |
|---|---|
register |
Register a new worker class and optional aliases. |
list_available |
Return a list of supported worker names. |
create |
Instantiate a worker class by name or alias. |
get_component_info |
Return metadata about a registered worker. |