Run Queries in Background from RESTXQ App?

Saturday, 4 July 2015 · 3 messages · last reply 5 Jul 2015
EK
Eliot Kimber4 Jul 2015 22:26 #
I'm creating a RESTXQ-based Web application. One of things I need to do is have a REST method that then does a potentially long-running operation against the database. I don't see an obvious way to to start a long query and not have it block in the this configuration. If I had a standalone client app (e.g., a Java app that provided the UI) then it would be no problem, just create a new connection for the long-running app. But in the context of a RESTXQ application is there a way to do it? I didn't see anything obvious in the docs but I'm not sure I know what to look for. Thanks, Eliot ---- Eliot Kimber, Owner Contrext, LLC http://contrext.com
EK
Eliot Kimber4 Jul 2015 22:49 #
I think I wasn't thinking clearly about the problem. If I have a link from one page of the Web app to a REST URL, the results of that URL have to be shown so without using Javascript to submit the URL there will always be a separate result, which I can direct to a separate browser window. So it's not really an issue. And if I wanted things to be a bit more sophisticated I would use Javascript to submit the REST URL and manage the response, however long it took to return. Cheers, E. ---- Eliot Kimber, Owner Contrext, LLC http://contrext.com On 7/4/15, 1:26 PM, "Eliot Kimber" <basex-talk-bounces at mailman.uni-konstanz.de on behalf of
Quoted text · Eliot Kimber · 28 lines
ekimber at contrext.com> wrote: >I'm creating a RESTXQ-based Web application. One of things I need to do is >have a REST method that then does a potentially long-running operation >against the database. > >I don't see an obvious way to to start a long query and not have it block >in the this configuration. > >If I had a standalone client app (e.g., a Java app that provided the UI) >then it would be no problem, just create a new connection for the >long-running app. > >But in the context of a RESTXQ application is there a way to do it? I >didn't see anything obvious in the docs but I'm not sure I know what to >look for. > >Thanks, > >Eliot > >---- >Eliot Kimber, Owner >Contrext, LLC >http://contrext.com > > > >
CG
Christian Grün5 Jul 2015 15:22 #
Hi Eliot, It seems you already found the solution that works for your use case (and I can't propose anything better anyway ;). I'd just like to indicate that there has been some initial discussion on asynchronous requests in the GitHub tracker [1]. Cheers, Christian [1] https://github.com/BaseXdb/basex/issues/989
Quoted text · Eliot Kimber · 56 lines
On Sat, Jul 4, 2015 at 8:49 PM, Eliot Kimber <ekimber at contrext.com> wrote: > I think I wasn't thinking clearly about the problem. > > If I have a link from one page of the Web app to a REST URL, the results > of that URL have to be shown so without using Javascript to submit the URL > there will always be a separate result, which I can direct to a separate > browser window. > > So it's not really an issue. And if I wanted things to be a bit more > sophisticated I would use Javascript to submit the REST URL and manage the > response, however long it took to return. > > Cheers, > > E. > ---- > Eliot Kimber, Owner > Contrext, LLC > http://contrext.com > > > > > On 7/4/15, 1:26 PM, "Eliot Kimber" > <basex-talk-bounces at mailman.uni-konstanz.de on behalf of > ekimber at contrext.com> wrote: > >>I'm creating a RESTXQ-based Web application. One of things I need to do is >>have a REST method that then does a potentially long-running operation >>against the database. >> >>I don't see an obvious way to to start a long query and not have it block >>in the this configuration. >> >>If I had a standalone client app (e.g., a Java app that provided the UI) >>then it would be no problem, just create a new connection for the >>long-running app. >> >>But in the context of a RESTXQ application is there a way to do it? I >>didn't see anything obvious in the docs but I'm not sure I know what to >>look for. >> >>Thanks, >> >>Eliot >> >>---- >>Eliot Kimber, Owner >>Contrext, LLC >>http://contrext.com >> >> >> >> > >

⚡Generated with XQuery