RESTXQ: How to Reflect Progress of Long-Running Querries
In my Mirabel system, I have multiple BaseX instances to handle long-running processes while a primary instance serves the web pages.
For these background processes I’d like to be able to show progress in the main web app.
My question: what are the options for doing this?
I can imagine having a database to write progress data to and then read from that in my RESTXQ page (maybe using a simple JavaScript to poll the app).
Are there better techniques? I’m trying to limit the amount of JavaScript I have to write but I can do it if I have to.
Thanks,
E. _____________________________________________ Eliot Kimber Sr Staff Content Engineer O: 512 554 9368 M: 512 554 9368 servicenow.com<https://www.servicenow.com> LinkedIn<https://www.linkedin.com/company/servicenow> | Twitter<https://twitter.com/servicenow> | YouTube<https://www.youtube.com/user/servicenowinc> | Facebook<https://www.facebook.com/servicenow>
Hi Eliot,
If all BaseX worker instances use the client/server architecture [1], the Client Module [2] could be used to request the list of currently running queries via jobs:list-details [3]. And I’m also convinced that’s not the most obvious solution …
Christian
[1] https://docs.basex.org/wiki/Database_Server [2] https://docs.basex.org/wiki/Client_Module [3] https://docs.basex.org/wiki/Jobs_Module
Quoted text · Eliot Kimber · 15 lines
On Fri, Jul 15, 2022 at 5:01 PM Eliot Kimber <eliot.kimber at servicenow.com> wrote: > > In my Mirabel system, I have multiple BaseX instances to handle long-running processes while a primary instance serves the web pages. > > For these background processes I’d like to be able to show progress in the main web app. > > My question: what are the options for doing this? > > I can imagine having a database to write progress data to and then read from that in my RESTXQ page (maybe using a simple JavaScript to poll the app). > > Are there better techniques? I’m trying to limit the amount of JavaScript I have to write but I can do it if I have to. > > Thanks, > E.
Written for BaseX 9.7. BaseX may have changed since: please check the current documentation.