Hi Darin, Is it an idea to use the Content Processing Framework for this? It spawns processes when conditions are met just as well, without the need to create a sleeping/polling thread for this. The trigger system will automatically start matching conditions as soon as an update is done.
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 www.daidalos.nl<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 Wayne Feick Sent: dinsdag 10 november 2009 21:54 To: General Mark Logic Developer Discussion Subject: Re: [MarkLogic Dev General] Question about TaskServer and Threads 1) You could build a cron-like service by describing each when/condition/task combination in a document and then having a scheduled task that looks for these documents, runs their conditions, and spawns the task if the condition is met. There are a few ways you could design something like this, but the key bit is to use a scheduled task to see which things should be run. Serialized queries and reverse-query might come in handy as well. 2) yes On Tue, 2009-11-10 at 12:43 -0800, Darin McBeath wrote: Assume that I have spawned a task to the TaskServer. The spawned task checks for a 'condition' If this 'condition' is true(), then the task will complete. If the 'condition' is false(), the task will sleep for a specified interval (such as 15 seconds) and then will spawn a task to do basically the same check. This process will continue until the 'condition' evaluates to true. Couple of questions. 1. Is there a better way of accomplishing the goal outlined above? The above appears to work but was curious if others had a better idea. 2. When you use xdmp:sleep within a task on the Task Server, are you still consuming one of the threads which are configured for the Task Server during this period of sleep time? I wouldn't want to run into a situation where all of my configured threads are doing this 'condition' check instead of the real work. Thanks. Darin.
_______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
