Async Module
Tuesday, 1 March 2016 · 4 messages · last reply 3 Apr 2016
CG
Christian Grün1 Mar 2016 17:09 #
Hi everyone,
As some of you know, James Wright has presented his excellent work on the Promise Module in Prague [1,2].
The promise:fork-join function is now part of BaseX, along with some additional functions for asynchronous query processing [3,4].
Your feedback is welcome as usual,
Christian
[1] https://github.com/james-jw/xq-promise/
[2] http://archive.xmlprague.cz/2016/files/xmlprague-2016-proceedings.pdf [3] http://docs.basex.org/wiki/Async_Module
[4] http://files.basex.org/releases/latest/
ML
Marco Lettere1 Mar 2016 17:35 #
Huge news!!!
I'll throw away my code for doing this. Unless someone wants to have a look at it! :D :D :D
Thank you guys.
Regards,
Marco.
Quoted text · Christian Grün · 17 lines
On 01/03/2016 17:09, Christian Grün wrote: > Hi everyone, > > As some of you know, James Wright has presented his excellent work on > the Promise Module in Prague [1,2]. > > The promise:fork-join function is now part of BaseX, along with some > additional functions for asynchronous query processing [3,4]. > > Your feedback is welcome as usual, > Christian > > [1] https://github.com/james-jw/xq-promise/ > [2] http://archive.xmlprague.cz/2016/files/xmlprague-2016-proceedings.pdf > [3] http://docs.basex.org/wiki/Async_Module > [4] http://files.basex.org/releases/latest/ >
AB
Hi Christian,
This is great. I particularly like the way errors in the async execution are captured:
declare function local:result($id){
try{
map{ "result":async:result($id)
}
} catch * {
map{ "error": map {
'code': $err:code,
'description': $err:description,
'module': $err:module,
'line': $err:line-number,
'column': $err:column-number,
'value': $err:value
}
}
}
};
async:ids()!local:result(.)I see async:update is marked as an updating function.Is this correct as it also returns a result? I would have thought it causes an update later but it is not itself updating. This causes problems as the query id can not be captured or suppressed from the output.
/Andy
Quoted text · Christian Grün · 17 lines
On 1 March 2016 at 16:09, Christian Grün <christian.gruen at gmail.com> wrote: > Hi everyone, > > As some of you know, James Wright has presented his excellent work on > the Promise Module in Prague [1,2]. > > The promise:fork-join function is now part of BaseX, along with some > additional functions for asynchronous query processing [3,4]. > > Your feedback is welcome as usual, > Christian > > [1] https://github.com/james-jw/xq-promise/ > [2] http://archive.xmlprague.cz/2016/files/xmlprague-2016-proceedings.pdf > [3] http://docs.basex.org/wiki/Async_Module > [4] http://files.basex.org/releases/latest/ >
CG
Christian Grün3 Apr 2016 18:47 #
Hi Andy,
Quoted text · Andy Bunce · 2 lines
> I see async:update is marked as an updating function.Is this correct as it > also returns a result?
Thanks to your valuable hint, I noticed that there is no need to have an updating version at all! You can now use async:eval for both updating and non-updating queries. The new snapshot is available in a few minutes.
Christian
Quoted text · Christian Grün · 19 lines
> On 1 March 2016 at 16:09, Christian Grün <christian.gruen at gmail.com> wrote: >> >> Hi everyone, >> >> As some of you know, James Wright has presented his excellent work on >> the Promise Module in Prague [1,2]. >> >> The promise:fork-join function is now part of BaseX, along with some >> additional functions for asynchronous query processing [3,4]. >> >> Your feedback is welcome as usual, >> Christian >> >> [1] https://github.com/james-jw/xq-promise/ >> [2] http://archive.xmlprague.cz/2016/files/xmlprague-2016-proceedings.pdf >> [3] http://docs.basex.org/wiki/Async_Module >> [4] http://files.basex.org/releases/latest/ > >
Written for BaseX 8.4. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery