state
State submodule providing functionality related to persisting process or component state.
StateBackend
Bases: ABC, ExportMixin
StateBackend defines an interface for managing process state.
Instantiates StateBackend.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
job_id
|
Optional[str]
|
The unique id for the job. |
None
|
metadata
|
Optional[dict]
|
Metadata key value pairs. |
None
|
kwargs
|
Any
|
Additional keyword arguments. |
{}
|
__aexit__
async
__aexit__(
exc_type: Optional[Type[BaseException]],
exc_value: Optional[BaseException],
traceback: Optional[TracebackType],
) -> None
Exits the context manager.
get_process_for_component
async
Gets the process that a component belongs to.
get_process_status
async
Gets the status of a process from the state.
get_process_status_for_component
async
Gets the status of the process that a component belongs to.
update_process_status
async
Updates the status of a process in the state.
upsert_component
async
Upserts a component into the state.
upsert_connector
async
Upserts a connector into the state.
DictStateBackend
Bases: StateBackend
DictStateBackend provides state persistence for single process runs.
Instantiates DictStateBackend.
SqliteStateBackend
Bases: StateBackend
SqliteStateBackend handles single host persistent state.
Initializes SqliteStateBackend with db_path.
get_process_for_component
async
Gets the process that a component belongs to.
get_process_status
async
Gets the status of a process from the state.
get_process_status_for_component
async
Gets the status of the process that a component belongs to.
update_process_status
async
Updates the status of a process in the state.
upsert_component
async
Upserts a component into the state.
upsert_connector
async
Upserts a connector into the state.