ConnectorRegistry
This is the registry for all connectors. The connector service will look up the connector registry based on the task type and version.
Methods
register()
@classmethod
def register(
connector: [AsyncConnector](asyncconnector.md?sid=flyte_connectors__connector_asyncconnector),
override: bool = False
)
Registers a connector with the registry, associating it with a specific task type and version. This allows the system to look up and use the correct connector based on task metadata.
Parameters
| Name | Type | Description |
|---|---|---|
| connector | [AsyncConnector](asyncconnector.md?sid=flyte_connectors__connector_asyncconnector) | The asynchronous connector instance to register. |
| override | bool = False | A boolean indicating whether to override an existing connector if one is already registered for the same task type and version. If false and a duplicate exists, a ValueError is raised. |
get_connector()
@classmethod
def get_connector(
task_type_name: str,
task_type_version: int = 0
) - > [AsyncConnector](asyncconnector.md?sid=flyte_connectors__connector_asyncconnector)
Retrieves a registered connector based on its task type name and version. This method is used by the connector service to find the appropriate connector for a given task.
Parameters
| Name | Type | Description |
|---|---|---|
| task_type_name | str | The name of the task type for which to retrieve the connector. |
| task_type_version | int = 0 | The version of the task type for which to retrieve the connector. |
Returns
| Type | Description |
|---|---|
[AsyncConnector](asyncconnector.md?sid=flyte_connectors__connector_asyncconnector) | The AsyncConnector instance associated with the specified task type and version. |