Changes

Jump to navigation Jump to search
19 bytes removed ,  20:30, 18 July 2022
no edit summary
=Executing Jobs=
There are cases in which a client does not, or cannot, wait until a request is fully processed. The client may be a browser, which sends an HTTP request to the server in order to start another time-consuming query job. The functions in this section allow you to register a new query job from a running query. Jobs can be executed immediately (i.e., as soon as the [[Transaction Management#Concurrency Control|Concurrency Control]] allows it) or scheduled for repeated execution. Each registered job gets a job id, and the id can be used to retrieve a query result, stop a job, or wait for its termination.
==job:eval==
|-
| '''Summary'''
|Schedules the evaluation of the supplied {{Code|$query}} ({{Code|xs:string}}, or of type {{Code|xs:anyURI}}, pointing to a resource), and returns a query id. The query will be queued, and the result will optionally be cached. Queries can be updating. Variables and the context value can be declared via {{Code|$bindings}} (see [[{{Function|XQuery Module#xquery:eval|xquery:eval]] }} for more details). The following {{Code|$options}} can be supplied:
* {{Code|cache}}: indicates if the query result will be cached or ignored (default: <code>false</code>):
** The result will be cached in main-memory until it is fetched via {{Function||job:result}}, or until {{Option|CACHETIMEOUT}} is exceeded.
| '''Summary'''
|Indicates if the evaluation of an already running job with the specified {{Code|$id}} has finished. As the ids of finished jobs will usually be discarded, unless caching is enabled, the function will also return <code>true</code> for unknown jobs.
* <code>false</code> indicates that the job id ID is scheduled, queued, or currently running.* <code>true</code> will be returned if the job has either finished, or if the id ID is unknown (because the ids IDs of all finished jobs will not be cached).
|}
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu