controller.py
This module defines an PipelineController responsible for managing a pipeline of processes and handling potential errors that occur during their execution.
Classes:
| Name | Description |
|---|---|
PipelineController |
Manages a pipeline of processes and handles errors that occur during. |
Copyright (C) 2025 Matti Kaupenjohann
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
PipelineController
¶
Coordinates pipeline permanences and processes.
Responsibilities: - Manage permanence lifecycle - Provide permanence access to processes - Instantiate processes with their parameters - Yield processes for execution
Source code in tipi/core/controller.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | |
cleanup()
¶
Cleanup all permanences.
Source code in tipi/core/controller.py
93 94 95 96 | |
get_permanence(name, default=_MISSING)
¶
Get a permanence by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the permanence to retrieve |
required |
default
|
Any
|
Value to return if permanence not found. If not provided, raises PermanenceKeyError instead. Can be None. |
_MISSING
|
Returns:
| Type | Description |
|---|---|
Any
|
The permanence instance or default value |
Raises:
| Type | Description |
|---|---|
PermanenceKeyError
|
If permanence not found and no default provided |
Source code in tipi/core/controller.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | |
get_permanence_count()
¶
Get total number of permanences.
Source code in tipi/core/controller.py
89 90 91 | |
get_process_count()
¶
Get total number of processes.
Source code in tipi/core/controller.py
81 82 83 | |
iterate_permanences()
¶
Yield permanence instances for cleanup or inspection.
Source code in tipi/core/controller.py
85 86 87 | |
iterate_processes()
¶
Yield (index, process_instance) for execution.
Source code in tipi/core/controller.py
75 76 77 78 79 | |