=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 to start another time-consuming query job. The functions in this section allow you to register a new query job from a running queryjobs and access existing ones. Jobs can be executed immediately (i.e., as soon as the a [[Transaction Management#Concurrency Control|Concurrency Controlfree slot is available]] 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==
|- valign="top"
| '''Summary'''
|Schedules the evaluation a new query job for the supplied {{Code|$query}} (of type {{Code|xs:string}}, or of type {{Code|xs:anyURI}} if points to a resource), and returns a job ID. The query job will be queueduntil a free slot is available, and the query result will optionally can be cached. Queries can be updating. Variables , and variables and the context value can be declared via {{Code|$bindings}} (see {{Function|XQuery|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}}):
** The result will be cached in main-memory until it is fetched via {{Function||job:result}}, or until {{Option|CACHETIMEOUT}} is exceeded.