Changes

Jump to navigation Jump to search
49 bytes added ,  15:42, 10 May 2021
==Query Execution==
In many RESTXQ web search scenarios, user input from browser forms is processed and search results are returned. User experience Such operations can generally be made more interactive if an updated by sending a new search request is triggered to the server with each key click. However, this may lead to many expensive parallel server-side requests, from which only the result of the last request will be relevant for the client.
With the <code>%rest:single</code> annotation, it can be enforced that only one instance of a function will be executed run at the same time and for the same client. If the same function will be called for the second time, the already running a currently executed query will be stopped, and the HTTP error code {{Code|460}} will be returned instead:
<syntaxhighlight lang="xquery">
</syntaxhighlight>
By specifying adding a string along value to with the annotation, functions can be bundled together, and one request a running query can be canceled by calling another onethat has the same annotation value. This is shown by another example, in which the first function can be interrupted by the second one. If you call both functions in separate browser tabs, you will note that the first tab will return <code>460</code>, and the second one will return <xml>stopped</xml>.
<syntaxhighlight lang="xquery">
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu