diff --git a/pygeoapi/process/base.py b/pygeoapi/process/base.py index 5235d5f..f225beb 100644 --- a/pygeoapi/process/base.py +++ b/pygeoapi/process/base.py @@ -49,10 +49,27 @@ class BaseProcessor: :returns: pygeoapi.processor.base.BaseProvider """ + self.name = processor_def['name'] self.metadata = process_metadata self.supports_outputs = False + def set_job_id(self, job_id: str) -> None: + """ + Set the job_id within the processor + To be implemented by derived classes where required. + + :param job_id: the job_id assigned to the request by the Manager. + The function shuold be called by the Manager upon + assigning the job_id. The job_id is intended to be used + by derived classes, e.g. to write temporary files where + filenames contains the string job_id. + + :returns: `None` + """ + + pass + def execute(self, data: dict, outputs: Optional[dict] = None ) -> Tuple[str, Any]: """ diff --git a/pygeoapi/process/manager/base.py b/pygeoapi/process/manager/base.py index 5c9a12e..c39007d 100644 --- a/pygeoapi/process/manager/base.py +++ b/pygeoapi/process/manager/base.py @@ -355,6 +355,8 @@ class BaseManager: job_id = str(uuid.uuid1()) processor = self.get_processor(process_id) + processor.set_job_id(job_id) + if execution_mode == RequestedProcessExecutionMode.respond_async: job_control_options = processor.metadata.get( 'jobControlOptions', [])