Welcome to WebProNews Breaking eBusiness and Search News
Advertise | Newsletter | Sitemap | News Feeds News Feed 
 WebProNews Search Part of the iEntry network iEntry inc. 

The CFTHREAD Scope

Raymond Camden
Expert Author
Published: 2007-07-27

WebProNews RSS Feed


Did you know that ColdFusion 8 has a new scope? The CFTHREAD scope is a special scope that contains information about threads in the current request.

Consider this simple example:

<cfset urls =
"http://www.cnn.com,http://www.coldfusionjedi.com,
http://www.yahoo.com">

<cfset counter = 0>
<cfloop index="u" list="#urls#">
   <cfset counter++ >
   <cfthread theurl="#u#" name="thread_#counter#">
    <cfhttp url="#attributes.theurl#">
   </cfthread>
</cfloop>

<cfdump var="#cfthread#">


This code block creates 3 threads, named thread_1, thread_2, and thread_3. (I don't get paid to be creative!) Each thread created will exist as a structure inside the CFTHREAD scope as demonstrated in this screen shot:



You will notice that not all of my threads are finished. That is because I didn't do a join on my threads. If you look at Paragator, my ColdFusion RSS Aggregator CFC, you will see I kept a list of all threads so that I could join them. I then used Evalute to create pointers to the data. This can be done a lot easier now. So for example, to join all threads:

<cfthread action="join" name="#structKeyList(cfthread)#" />

And to get access to a thread's data:

<cfdump var="#cfthread[somethreadname]#">

I'll be updating Paragator a bit later in the week.

Comments

View All Articles by Raymond Camden



Receive Our Daily Email of Breaking eBusiness News


About the Author:
Raymond Camden, ray@camdenfamily.com
http://ray.camdenfamily.com

Raymond Camden is Vice President of Technology for roundpeg, Inc. A long time ColdFusion user, Raymond has worked on numerous ColdFusion books and is the creator of many of the most popular ColdFusion community web sites. He is an Adobe Community Expert, user group manager, and the proud father of three little bundles of joy.

WebProNews RSS Feed

More Expert Articles Articles

Contact WebProNews
Advertisement





TOP NEWS

WebProBlog
The official blog of WebProNews.

Go to WebProBlog

Targeted Information for Business
WebProNews is part of the iEntry network

Internet Business: Marketing: Small Business:
WebProNews MarketingNewz SmallBusinessNewz
WebProWorld AdvertisingDay PromoteNews
EcommNewz SalesNewz EntrepreneurNewz

Software: Search Engines: Web Design:
WebMasterFree Jayde B2B DesignNewz
NetworkingFiles SearchZA FlashNewz
SecurityConfig SearchNewz WebSiteNotes

Developer: IT Management: Security:
DevWebPro ITManagement SecurityProNews
DevNewz SysAdminNews SecurityConfig
TheDevWeb NetworkingFiles NetworkNewz

The iEntry Network consists of over 100 web publications reaching millions of Internet Professionals. Contact us to advertise.
eBUSINESS RESOURCES






 Advertise | Contact Us | Corporate | Newsletter | Sitemap | Submit an Article | News Feeds
 WebProNews is an iEntry, Inc. ® publication - $line) { echo $line ; } ?> All Rights Reserved
WebProWorld
Ten most recent posts.


SearchBrains.com
NetworkingFiles
Featured Software


About WebProNews
WebProNews is the number one source for eBusiness News. Over 5 million eBusiness professionals read WebProNews and other iEntry business and tech publications.

WebProNews provides real-time coverage of internet business.

Free Email Newsletters:
WebProNews SearchNewz
WebProWorld DevWebPro
Marketing SecurityNews
Plus over 100 other newsletters!

Send me relevant info on products and services.


iEntry.com WebProWorld RSS Feed WebProWorld Contact WebProNews Print Version Email a friend Bookmark us SearchBrains.com SearchBrains RSS Feed