opengeospatial / ogcapi-processes

Home Page:https://ogcapi.ogc.org/processes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Notification support ... and perhaps better asynch support too ...

pvretano opened this issue · comments

The current approach for getting execution status of the a process is via polling of a pull notification. I think that we also need to support some type of lightweight notification too. Specifically I think we should add a "responseHandler" parameter to the execute request. The value of the response handler can be something like 'mailto:pvretano@cubewerx.com' or 'sms:4167015555' or a web hook or callback URL 'http://www.blah.com/path/path/path...'.

The existence of the 'responseHandler' parameter would automatically trigger asynchronous execution . The immediate response would be an acknowledgement message that might look like this:
{
"links": [
{"rel": "monitor",
"href": "http://www.someserver.com/jobs/1013"},
{"rel": "cancel",
"href": "http://www.someserver.com/jobs/cancel/1013"},
"status": "accepted"
}
At this point the user can do nothing and simply wait for the process to complete at which time a notification will be send to the response handler(s) specified with the request.

However, the client also has the option to use the included hypermedia controls for monitor or cancel (dismiss I guess) execution of the process. Say, the client resolved the "monitor" link, they may get a response that looks like this:
{
"links": [
{"rel": "monitor",
"href": "http://www.someserver.com/jobs/1013"},
{"rel": "cancel",
"href": "http://www.someserver.com/jobs/cancel/1013"},
"status": "executing",
"percentCompleted": 47
}
However, it should be noted that the client does not HAVE to resolve the included links. When the process completes, a notification message will be sent to the response handler(s) and the client can pick up the results at that point (or have it done auto-magically if the response handler was a web hook or callback).
Anyway, the details for the responseHandler parameter can be found here:
https://docs.opengeospatial.org/per/18-045.html#async_extension