-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support services to decide responding asynchronously #2015
Comments
No objection to the approach in general. How to annotate this server behavior needs to be fleshed out. |
Possible name for the capability
Services must also specify "Async...Supported" - document by making it the base term. Should this be on container, on entity set, on operation, ...? Maybe not a "capability" but a "requirement" or "enforcement"? No, we already have Restrictions in Capabilities. |
Update from discussion on 2024-11-27 We identified these options: Option A
Option B Conclusion |
Because the preferred option would introduce a breaking change, we will move this to V5. |
This issue complements the discussion in issue #1961 with a proposal to extend service capabilities for asynchronous processing with callbacks
Status Quo
The current specification supports asynchronous processing only if triggered by the client using preference
respond-async
(8.2.8.8 Preference respond-async). Moreover, the spec explicitly prohibits services to return status code 202 with aLocation
header if the request has not included the respond-async preference.Extended Requirement
There are scenarios, however, where the service may want to decide on its own discretion to return the result asynchronously.
The reason could be at design-time, because the service implements query processing asynchronously, e.g. offload it to a task queue. More advanced implementations could decide at runtime for the given request to deviate from default synchronous processing, e.g. because the server load is currently high, the overall response time is estimated to be large, the logic to create the query result is complex. In such cases, the service would return a 202 with location response header, which is not allowed by the current spec.
Approach
A service that wants to respond to requests asynchronously exposes this behavior as a metadata annotation of a new term in the Capability vocabulary, e.g.
Capabilities.AsynchronousRequestsObligatory
. The scope could be expressed, i.e. for which type of requests, for which service resources.Such an annotation would require a client to include the
respond-async
preference in every request in scope, otherwise the service rejects the request with a 404 status code. For the given request, the service decides if it is processed asynchronously, and returns the result inPreference-Applied
accordingly.The text was updated successfully, but these errors were encountered: