Baseaction¶
flowtask.components.BaseAction
¶
BaseAction
¶
Bases: FlowComponent, ABC
BaseAction Component
Overview
Basic component for making RESTful queries to URLs.
This component serves as a foundation for building more specific action components.
It allows you to define methods (functions) that can be executed asynchronously.
.. table:: Properties
:widths: auto
+-----------------------+----------+-----------+---------------------------------------------------------------------------------------------------------------+
| Name | Required | Summary |
+-----------------------+----------+-----------+---------------------------------------------------------------------------------------------------------------+
| loop (optional) | No | Event loop to use for asynchronous operations (defaults to the current event loop). |
+-----------------------+----------+-----------+---------------------------------------------------------------------------------------------------------------+
| job (optional) | No | Reference to a job object for logging and tracking purposes. |
+-----------------------+----------+-----------+---------------------------------------------------------------------------------------------------------------+
| stat (optional) | No | Reference to a stat object for custom metrics collection. |
+-----------------------+----------+-----------+---------------------------------------------------------------------------------------------------------------+
| method (from kwargs) | Yes | Name of the method (function) within the component to be executed. Specified as a keyword argument during initialization. |
+-----------------------+----------+-----------+---------------------------------------------------------------------------------------------------------------+
**Returns**
The output data can vary depending on the implemented method. It can be a list, dictionary, or any data structure returned by the executed method.
**Error Handling**
- `DataNotFound`: This exception is raised if the executed method doesn't return any data.
- `ComponentError`: This exception is raised for any other errors encountered during execution.