Hi all,
I just started to use the async module and I guess I am out of sync about the relation to xq-promise:
Basex now has asyn:fork-join which exectues in parallel and comes back with all results
xq-promise has p:fork-join which seems to be the previous implementation
Could I swap one for the other?
Side note: async:eval which works like xquery:eval is great, but I have to do something like this for functions:
``` let $ids := async:eval("declare variable $f external; declare variable $name external; $f($name)", map { 'f': '_:get-meta', 'name' : $name })
return $ids ```
With get-meta being a local function that accepts a single parameter. Is there an easier way to do this?
Regards,
Max
Hi Max,
xq-promise has p:fork-join which seems to be the previous implementation Could I swap one for the other?
Right! A side note: I have slightly extended our documentation, because I guess it was not clearly to everyone what’s the difference between parallel and asynchronous execution [1].
let $ids := async:eval("declare variable $f external; declare variable $name external; $f($name)", map { 'f': '_:get-meta', 'name' : $name }) return $ids
With get-meta being a local function that accepts a single parameter. Is there an easier way to do this?
Hm. If you have a single argument, you could bind it to the context item:
async:eval(".", map { '': $var })
If you have several variables, it may be better to write an extra function, which prefixes your query with additional variable declarations (see e.g. here: [2]).
Best, Christian
[1] http://docs.basex.org/wiki/Async_Module [2] https://github.com/BaseXdb/basex/blob/master/basex-api/src/main/webapp/dba/m...
Regards,
Max
basex-talk@mailman.uni-konstanz.de