idmtools.core.task_factory module¶
Define our tasks factory. This is crucial to build tasks when fetching from the server.
Copyright 2021, Bill & Melinda Gates Foundation. All rights reserved.
- class idmtools.core.task_factory.DynamicTaskSpecification(task_type: Type[ITask], description: str = '')¶
Bases:
TaskSpecification
This class allows users to quickly define a spec for special tasks.
- __init__(task_type: Type[ITask], description: str = '')¶
Initialize our specification.
- Parameters:
task_type – Task type to register
description – Description to register with task
- get(configuration: dict) ITask ¶
Get an instance of our task using configuration.
- Parameters:
configuration – Configuration keyword args.
- Returns:
Task with configuration specified
- class idmtools.core.task_factory.TaskFactory¶
Bases:
object
TaskFactory allows creation of tasks that are derived from plugins.
- DEFAULT_KEY = 'idmtools.entities.command_task.CommandTask'¶
- __init__()¶
Initialize our Factory.
- register(spec: TaskSpecification) NoReturn ¶
Register a TaskSpecification dynamically.
- Parameters:
spec – Specification to register
- Returns:
None