Hi Jakob, You are looking for unbuffered response streams, but sending of the response is handled fully by the HTTP server. I don't believe you can influence that.
Giving it some more thought, I am afraid that allowing unbuffered responses would break the idea of transactions. You don't want to send back response, unless you can guarantee no exceptions will be thrown. And I don't think that can be guaranteed. Perhaps a MarkLogic expert would like to comment? Hasn't this been discussed before? It vaguely rings a bell.. Kind regards, Geert > Drs. G.P.H. Josten Consultant http://www.daidalos.nl/ Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 http://www.daidalos.nl/ KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. > From: [email protected] > [mailto:[email protected]] On Behalf Of > Jakob Fix > Sent: donderdag 25 juni 2009 1:39 > To: General Mark Logic Developer Discussion > Subject: [MarkLogic Dev General] force a "buffer write"? > > So, I've written a function that looks at one URL at a time > and returns true or false depending on its accessibility. > Now, my problem is that the result is returned only when all > (and that means potentially many) URLs have been checked. > Isn't there a way to "force a write"? I'm not sure I'm > expressing myself correctly, but hopefully you'll understand > what I mean. Thanks. > > (: consider this: if the timeout is 10 seconds, and I have > three "bad" URLs, I may have to wait up to 30 seconds before > seeing the results, isn't there a way to see a result every > ten seconds instead? :) > > for $url in $urls > return <xh:li>{$url}: > {utils:http-resource-available($url, $timeout)}</xh:li> > > > (: function that checks accessibility of a URL, written for > DOIs which are "placeholder" URLs which forward to the real URL :) > > declare function utils:http-resource-available > ($doi as xs:string, $oldtimeout as xs:integer?) as xs:boolean { > try { > > let $timeout := if ($oldtimeout) then $oldtimeout else 10 > > let $head := > xdmp:http-get(fn:concat($utils:doi-resolver, $doi), > <options > xmlns="xdmp:http"><timeout>{$timeout}</timeout></options>) > let $code := $head//xdh:code cast as xs:integer > let $location := $head//xdh:location > return ((fn:contains($location, > $utils:location-part-to-match)) and > ($code < 400)) (: we want 3XX or 2XX? :) > } catch ($ex) { > if ($ex/error:code eq 'SVC-SOCRECV') > then > fn:false() > else > xdmp:rethrow() > } > }; > > > _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
