engine
engine
Engine
Bases: ABC
Source code in src/qgis_server_light/worker/engine.py
31 32 33 34 35 36 37 38 39 40 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 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | |
available_job_info_classes: dict[str, type[QslJobInfoParameter]] = {}
instance-attribute
available_runner_classes: dict[str, type[Runner]] = {}
instance-attribute
available_runner_classes_by_job_info: dict[str, type[Runner]] = {}
instance-attribute
context = context
instance-attribute
info = self._initialize_infos()
instance-attribute
layer_cache = LayerCache()
instance-attribute
qgis = Qgis(svg_paths, log_level)
instance-attribute
status
property
__del__()
Source code in src/qgis_server_light/worker/engine.py
51 52 | |
__init__(context: EngineContext, runner_plugins: list[str], svg_paths: list[str] | None = None, log_level=logging.WARNING)
Source code in src/qgis_server_light/worker/engine.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |
process(job_info: QslJobInfoParameter, feedback: QgsProcessingFeedback | None = None) -> JobResult
Hands the job to the runner which is responsible for it.
Every runner gets its own copy of the context, so a runner can't change what the next job sees.
Parameters:
-
job_info(QslJobInfoParameter) –The job to solve.
-
feedback(QgsProcessingFeedback | None, default:None) –The feedback the job reports its progress to and is canceled through,
Noneif nobody listens.
Returns:
-
JobResult–The result the runner produced.
Source code in src/qgis_server_light/worker/engine.py
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | |
runner_plugin_by_job_info(job_info: QslJobInfoParameter) -> type[Runner]
Here we decide which plugin we load dynamically out of the available ones.
Parameters:
-
job_info(QslJobInfoParameter) –Is the parameter instance we check the available worker classes and there the job_info_class at each.
Returns:
-
type[Runner]–The selected runner class
Source code in src/qgis_server_light/worker/engine.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | |
set_crashed()
Source code in src/qgis_server_light/worker/engine.py
158 159 | |
set_processing()
Source code in src/qgis_server_light/worker/engine.py
161 162 | |
set_waiting()
Source code in src/qgis_server_light/worker/engine.py
155 156 | |
EngineContext
dataclass
Bases: JobContext
The engine hands its context on to every job, so it carries exactly the
attributes of JobContext. A new attribute is therefore added in one place only.
Source code in src/qgis_server_light/worker/engine.py
24 25 26 27 28 | |