Skip to content

Commit 94b3a87

Browse files
totycrotomkralidis
authored andcommitted
ogc api processes subscriber (geopython#1313)
* Exclude None from `get_processor` return type annotation An exception is raised in case of error, so it can't ever return None * Add support for OGC API Processes Subscriber The subscription URLs are passed to the manager, which then has to call them appropriately. By default, managers have the attribute `supports_subscribing` set to `False` in order to not break the API for these. The subscriptions are only passed to if this is set to `True` * Add ogc api callback class to conformance https://docs.ogc.org/is/18-062r2/18-062r2.html#toc67 * Make successUri mandatory in subscriber It's mandatory in the standard. Thx @ricardogsilva ! * Use snake case in python for fields which are camel case in the api Thx @ricardogsilva ! * Add subscriber to method docstring * Provide default value for subscriber for managers not supporting it Thanks @ricardogsilva ! * Factor out notification call into methods This increases reusability by other managers Thanks @ricardogsilva ! * Add an example call for a process subscriber * Change test urls to valid urls * Third party imports in own block
1 parent af38787 commit 94b3a87

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

docs/source/data-publishing/ogcapi-processes.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,13 @@ Processing examples
108108
-H "Prefer: respond-async"
109109
-d "{\"inputs\":{\"name\": \"hi there2\"}}"
110110
111-
# execute a job for the ``hello-world`` process with a success subscriber
111+
# execute a job for the ``hello-world`` process with a success subscriber
112112
curl -X POST http://localhost:5000/processes/hello-world/execution \
113113
-H "Content-Type: application/json" \
114114
-d "{\"inputs\":{\"name\": \"hi there2\"}, \
115115
\"subscriber\": {\"successUri\": \"https://www.example.com/success\"}}"
116116
117+
117118
.. _`OGC API - Processes`: https://ogcapi.ogc.org/processes
118119
.. _`sample`: https://github.com/geopython/pygeoapi/blob/master/pygeoapi/process/hello_world.py
119120
.. _`TinyDB`: https://tinydb.readthedocs.io/en/latest

pygeoapi/process/manager/base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,8 @@ def _execute_handler_sync(self, p: BaseProcessor, job_id: str,
320320
self.update_job(job_id, job_metadata)
321321
self._send_failed_notification(subscriber)
322322

323+
self._send_failed_notification(subscriber)
324+
323325
return jfmt, outputs, current_status
324326

325327
def execute_process(

0 commit comments

Comments
 (0)