Back to bricks list
Introduction
Technical Documentation
Other Classes
TaskRunner
Version

TaskRunner

This is used to run a Task. It can be used in unit test to test a Task.

Simply provide the task type, config params and inputs. then you can call the run method to test your task and check outputs

:raises MissingInputResourcesException: [description] :raises Exception: [description] :return: [description] :rtype: [type]

Functions

__INIT__

Initialize self. See help(type(self)) for accurate signature.

Parameters:
NameTypeDefault valueDescription
task_typeType
paramsDict
inputsDict
config_model_idstr
input_specsInputSpecs
output_specsOutputSpecs
ADD_LOG_OBSERVER

Method to create an observer and attached it to the task. The log will be available in the retuned BasicMessageObserver. This can be useful for testings

Return type:
BasicMessageObserver
ADD_OBSERVER

Method to create an observer and attached it to the task. The log will be available in the retuned BasicMessageObserver. This can be useful for testings

Parameters:
NameTypeDefault valueDescription
observerMessageObserver
CHECK_BEFORE_RUN

This method check the config and inputs and then execute the check before run of the task

Return type:
CheckBeforeTaskResult
FORCE_DISPATCH_WAITING_MESSAGES
GET_OUTPUT
Parameters:
NameTypeDefault valueDescription
output_namestr
Return type:
Resource
GET_OUTPUTS
Return type:
Dict
GET_TASK
Return type:
Task
RUN

This method, checks the config, inputs and then run the task

Return type:
Dict
RUN_AFTER_TASK
SET_INPUT
Parameters:
NameTypeDefault valueDescription
input_namestr
resourceResource
SET_PROGRESS_BAR
Parameters:
NameTypeDefault valueDescription
progress_barProgressBar