From: Adam R. <ad...@ex...> - 2008-06-20 08:49:23
|
Yeah I think the best way would be to add an asynchronous function call, and pass it an xquery function as a callback, you could keep some state by passing parameters when you setup the callback, something like - httpclient:get-async($a as xs:anyURI, $b as xs:boolean, $c as element()?, $d as function, $e as item()*, ...) as item() Where - $a is the URI to HTTP GET $b is whether to persist cookies $c is any HTTP Request Headers $d is the callback function - from util:function() $e are parameters to the callback function In this way you can issue all the requests asynchronously one after another and have a function called when each completes to do some post processing. I would be quite happy to implement this if you need the help, but somehow I think you will be fine. Underneath you might want to use a static instance of the MultiThreadedConnectionManager from the Apache Commons HTTPClient library for efficency and perhaps even adjust all the functions in the httpclient module to use this. http://hc.apache.org/httpclient-3.x/threading.html Cheers Adam. 2008/6/19 Andrzej Jan Taramina <an...@ch...>: > > Figured I would tap the collective intelligence of the eXistentialists! > > I have a situation where I need to be able to issue multiple HTTP requests > concurrently from an XQuery. Doing them serially and blocking on each one would > result in unacceptably long response times. BTW, each request would go to a > different remote server. > > I don't believe there is any way currently to do this using eXist's XQuery > implementation. > > Any ideas on how difficult it might be to extend eXist's XQuery implementation > to support the concept of concurrent tasks, joins, timeouts and the like? > > Thanks! > > -- > Andrzej Taramina > Chaeron Corporation: Enterprise System Solutions > http://www.chaeron.com > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > _______________________________________________ > Exist-open mailing list > Exi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-open > -- Adam Retter eXist Developer { England } ad...@ex... irc://irc.freenode.net/existdb |