Changes

Jump to navigation Jump to search
399 bytes added ,  14:40, 16 April 2019
This [[Module Library|XQuery Module]] contains functions for handling ''lazy'' items.
In contrast to standard XQuery items, a lazy item contains a reference to the actual data, and the data itself will only be retrieved if it is requested. Hence, possible errors will be postponed, and no memory will be occupied by a lazy item as long as its contents content has not been reqested requested yet.
The following BaseX functions return lazy items:
|-
| width='120' | '''Signatures'''
|{{Func|lazy:cache|$items as item()*|item ()*}}<br/>{{Func|lazy:cache|$items as item()*, $lazy as xs:boolean|item()*}}
|-
| '''Summary'''
|Caches the contents data of a lazy {{Code|$itemitems}}in a sequence:<br />* contents data of lazy items will be retrieved and cached in inside the item.* non-lazy items , or lazy items with cached contents data, will simply be passed through.* If {{Code|$lazy}} is set to {{Code|true()}}, caching will be deferred until the data is eventually requested. Streaming will be disabled: Data will always be cached before a stream is returned.Caching of a lazy items is advisable if an item will be processed more than once, or if the the targeted contents will data may not be available anymore at a later stage.
|-
| '''Example'''
=Changelog=
 
;Version 9.1
 
* Updated: [[#lazy:cache|lazy:cache]]: {{Code|$lazy}} argument added; support for sequences.
;Version 9.0
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu