Howdy, I'm trying to wrap my head around the best way to use cfthread
to manage a task queue.

I have a remote service that I call via cfhttp that does a processing
task. It is a commercial service and our license is based on the
number of simultaneous requests we can make against the service. So
lets say that I have 5 "ports" available to me, i.e., I can have 5
active requests at any given time. Additional requests will be refused
by the remote service.

On my side, I have a queue of requests that I need to get through.
What I'm trying to design is a simple setup where it launches the 5
allowed http requests using cfthread (each task is independent of the
others) and when one of the threads completes, it goes and grabs the
next item that needs to be sent to this remote service that way we are
utilizing all 5 ports to full effect.

I understand how to launch an individual thread. What I'm having
difficulty wrapping my head around is how to have it go fetch the next
item in the queue and launch a thread again until the queue has been
processed.

It kind of seems like what I want to be doing is having a top level
variable that keeps track of what the next item in the queue is, then
down at the thread level, have my threads in some sort of a "while"
statement that keeps going until the queue is done, then have the
completion of a thread return a value that launches that thread again
with the current value of the top level variable and then changes the
top level variable to the next item in the queue.

Any thoughts about the situation and ideas of how best to code it?

Thanks in advance,
Judah

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:314410
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to