Changes

Jump to navigation Jump to search
347 bytes added ,  18:11, 31 October 2018
=Services=
 
{{Mark|Introduced with Version 9.0:}}
Jobs can additionally be registered as persistent services. An additional {{Code|service}} option has been added to the options list of {{Function|Jobs|jobs:eval}} and {{Function|Jobs|jobs:invoke}}:
</pre>
'''Some more notes:'''
* All registered jobs will be scheduled for evaluation when the BaseX server or BaseX HTTP server is started.
* If a job service is outdated (e.g. because a supplied end time has been exceeded), it will be removed from the jobs file at startup time.
* Job services can be updated: If a new job is registered, and if there is already a job with the same id, the old entry will be replaced.
* The job definitions are stored in a {{Code|jobs.xml}} file in the database directory. It can also be edited manually.
==jobs:list-details==
 
{{Mark|Updated with Version 9.1:}} registration time added
{| width='100%'
* <code>id</code>: job id
* <code>type</code>: type of the job (command, query, REST, RESTXQ, etc.)
* <code>state</code>: current state of the job (: <code>scheduled</code>, <code>queued</code>, <code>running</code>, or <code>cached)</code>* <code>user</code>: the user who started the job* <code>duration</code>: evaluation time (for included if a job is running and or if the result was cached jobs)* <code>start</code>: dateTime string with next start of job (for jobs that included if a job will be executed repeatedly)* <code>time</code>: time when job was registered
|-
| '''Examples'''
</pre>
|}
 
==jobs:finished==
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|jobs:servicesfinished|$id as xs:string|element(job)*xs:boolean}}
|-
| '''Summary'''
|Returns a list Indicates if the evaluation of all jobs that have been persistently registered as [[#Services|Services]].|-| '''Errors'''|an already running job with the specified {{ErrorCode|services|#Errors$id}} Registered services cannot has finished. As the ids of finished jobs will usually be parseddiscarded, unless caching is enabled, the function will also return <code>true</code> for unknown jobs.* <code>false<br/code>indicates that the job id is scheduled, queued, or currently running.* <code>true</code> will be returned if the job has either finished, or if the id is unknown (because the ids of all finished jobs will not be cached).
|}
==jobs:finishedservices==
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|jobs:finishedservices|$id as xs:string|xs:booleanelement(job)*}}
|-
| '''Summary'''
|Indicates if the evaluation Returns a list of an already running job with the specified all jobs that have been persistently registered as [[#Services|Services]].|-| '''Errors'''|{{CodeError|$idservices|#Errors}} has finished. As the ids of finished jobs will usually Registered services cannot be discarded, unless caching is enabled, the function will also return <code>true</code> for unknown jobsparsed.* <code>false<br/code> indicates that the job id is scheduled, queued, or currently running.* <code>true</code> will be returned if the job has either finished, or if the id is unknown (because the ids of all finished jobs will not be cached).
|}
==jobs:invoke==
 
{{Mark|Introduced with Version 9.0:}}
{| width='100%'
=Changelog=
 
;Version 9.1
 
* Updated: {{Function|Jobs|jobs:list-details}}: registration time added.
;Version 9.0
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu