dp3.task_processing.task_executor ¶
TaskExecutor ¶
TaskExecutor(db: EntityDatabase, platform_config: PlatformConfig, elog: EventGroupType, elog_by_src: EventGroupType)
TaskExecutor manages updates of entity records,
which are being read from task queue (via parent
TaskDistributor
)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
db
|
EntityDatabase
|
Instance of EntityDatabase |
required |
platform_config
|
PlatformConfig
|
Current platform configuration. |
required |
Source code in dp3/task_processing/task_executor.py
register_task_hook ¶
Registers one of available task hooks
See: TaskGenericHooksContainer
in task_hooks.py
Source code in dp3/task_processing/task_executor.py
register_entity_hook ¶
Registers one of available task entity hooks
See: TaskEntityHooksContainer
in task_hooks.py
Source code in dp3/task_processing/task_executor.py
register_attr_hook ¶
Registers one of available task attribute hooks
See: TaskAttrHooksContainer
in task_hooks.py
Source code in dp3/task_processing/task_executor.py
process_task ¶
Main processing function - push datapoint values, running all registered hooks.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task
|
DataPointTask
|
Task object to process. |
required |
Returns: True if a new record was created, False otherwise, and a list of new tasks created by hooks
Source code in dp3/task_processing/task_executor.py
refresh_on_entity_creation ¶
Runs the on_entity_creation
hook for all entities of given type.
Returns:
Type | Description |
---|---|
list[DataPointTask]
|
List of new tasks created by hooks |