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 = '')[source]#
Bases:
TaskSpecification
This class allows users to quickly define a spec for special tasks.
- __init__(task_type: Type[ITask], description: str = '')[source]#
Initialize our specification.
- Parameters:
task_type – Task type to register
description – Description to register with task
- get(configuration: dict) ITask [source]#
Get an instance of our task using configuration.
- Parameters:
configuration – Configuration keyword args.
- Returns:
Task with configuration specified
- class idmtools.core.task_factory.TaskFactory[source]#
Bases:
object
TaskFactory allows creation of tasks that are derived from plugins.
- DEFAULT_KEY = 'idmtools.entities.command_task.CommandTask'#
- register(spec: TaskSpecification) NoReturn [source]#
Register a TaskSpecification dynamically.
- Parameters:
spec – Specification to register
- Returns:
None