I guess that I could probably leverage the CPF to accomplish the same goal, but 
it just seems a bit unnatural and a fairly heavy solution.  I think it would 
also be a bit complex and require more development time.

The scenario is as follows::

a) A user  requests content based on some action.  I then spawn potentially 
several tasks (for the user batch) to construct the .zip file(s)s containing 
this content.
b) I then want to notify the user (via email as an example) that their batch is 
complete (all of the zip files have been constructed).

As Wayne described below, creating a scheduled task that runs every 15 minutes 
(or so) and checks my various conditions is likely a much better option (clean 
and simple).  While I have not had time to implement (prove that it will work), 
it certainly sounds like it should.

Darin.






________________________________
From: Geert Josten <[email protected]>
To: General Mark Logic Developer Discussion <[email protected]>
Sent: Wed, November 11, 2009 4:09:38 AM
Subject: RE: [MarkLogic Dev General] Question about TaskServer and Threads

 
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
    
 
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.nlKvK 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

Reply via email to