Ajas,
Whether you use cfhttp or not, you can use cfthread to make sure a
dependency order exists.  With cfthread, you probably would not need a
sleep if set it up that the next thread cannot start until the first
one finishes.

I have not tried to just create a loop of threads over and over.  I am
sure it would work, but you would have to look at the how long each
thread takes versus how many iterations of your loop and test the
performance around your approach.  I favor threads for predictable
number of executions or some sort of one-off parallel execution.

If you put the document creation logic in a UDF or CFC, loop around
the function call as the function call will have to complete before
the next loop starts.  Otherwise, you will either need a sleep() or
some programmatic approach that will indicate when a document creation
has been completed before the next iteration of document creation.

Pseudo code:

<cfloop ...>

<cfset myUDForCFC.createDoc(argumentCollection=...) />

</cfloop>

Hopefully that answered some portion of your question.


Teddy R. Payne, ACCFD
Google Talk - teddyrpa...@gmail.com




On Thu, Mar 17, 2011 at 3:53 PM, Ajas Mohammed <ajash...@gmail.com> wrote:
> Teddy,
>
> The logic and cfpdf/cfdocument stuff is already in place i.e. on the page
> that needs to be called. I was thinking for 3 records returned, cfinclude
> would mean, create pdf, sleep, then create pdf, sleep, and finally create
> 3rd pdf. Whereas if I do cfhttp, it will 3 separate processes or can I call
> it threads, iam not sure, so, http://ip addr/test/doThis.cfm for 1st record,
> sleep, then another http://ip addr/test/doThis.cfm, sleep, and final 3rd
> call http://ip addr/test/doThis.cfm.
>
> So which method is better?
>
> <Ajas Mohammed />
> http://ajashadi.blogspot.com
> We cannot become what we need to be, remaining what we are.
> No matter what, find a way. Because thats what winners do.
> You can't improve what you don't measure.
> Quality is never an accident; it is always the result of high intention,
> sincere effort, intelligent direction and skillful execution; it represents
> the wise choice of many alternatives.
>
>
> On Thu, Mar 17, 2011 at 3:43 PM, Teddy R. Payne <teddyrpa...@gmail.com>
> wrote:
>>
>> Ajas,
>> You can probably just <cfpdf> or <cfdocument> for your document
>> creation after you save the content of each query loop and create
>> whatever display logic you need.
>>
>> As far as making aquery execute longer, try the sleep() function or
>> using cfthread with the sleep action.
>>
>>
>> Teddy R. Payne, ACCFD
>> Google Talk - teddyrpa...@gmail.com
>>
>>
>>
>>
>> On Thu, Mar 17, 2011 at 3:37 PM, Ajas Mohammed <ajash...@gmail.com> wrote:
>> > Hi,
>> >
>> > I am thinking of a CF schedule night 2 am job which will basically
>> > create a
>> > pdf based of query data.
>> >
>> > So first <cfquery> then <cfloop over that query data> and then question
>> > is
>> > do i want to include this pdf creation page by using cfinclude or do I
>> > use
>> > cfhttp call.
>> >
>> > Also, I would like a sleep call between first record and every
>> > subsequent
>> > record returned by query. So lets say, after pdf gets created for first
>> > record, there should be a delay like 7 secs , then 2nd record and so on.
>> >
>> > Let me know your opinion. I am dying to use cfhttp as I havent used that
>> > before. ;-)
>> >
>> > <Ajas Mohammed />
>> > http://ajashadi.blogspot.com
>> > We cannot become what we need to be, remaining what we are.
>> > No matter what, find a way. Because thats what winners do.
>> > You can't improve what you don't measure.
>> > Quality is never an accident; it is always the result of high intention,
>> > sincere effort, intelligent direction and skillful execution; it
>> > represents
>> > the wise choice of many alternatives.
>> >
>>
>>
>> -------------------------------------------------------------
>> To unsubscribe from this list, manage your profile @
>> http://www.acfug.org?fa=login.edituserform
>>
>> For more info, see http://www.acfug.org/mailinglists
>> Archive @ http://www.mail-archive.com/discussion%40acfug.org/
>> List hosted by http://www.fusionlink.com
>> -------------------------------------------------------------
>>
>>
>>
>
>


-------------------------------------------------------------
To unsubscribe from this list, manage your profile @ 
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------



Reply via email to