I’m looking for insight on how to build a system for my eXist DB App with which I can start multiple queries and have some kind of broker to ensure that only say the first 3 of them run simultaneously and when one of the queries is finished, it starts the next one waiting and so on.
I guess this can’t be done in pure Xquery, perhaps with some JavaScript hook? I also guess this means I have to look into Java Management Extensions, is that right?
In index.html of Monex the running queries seem to get displayed with the following code:
<span id="jmx-queries" data-bind="text: $data.jmx.ProcessReport.RunningQueries().length || 0">?</span>
I would like to replicate this in my own app and from here on look further into using jmx in my own app. So thanks for any input on how to do this or any help/further infos on how to achieve my main goal!
Thanks
You could keep the state of the queue in a document in the database, and you could have 3 scheduled tasks which poll that document. Each would pop the next item of the queue and run it. You can achieve all of that from XQuery.