I've not used cfthread before but i'm using the following code and it's not working.
<cfloop from="1" to="5" index="local.pageNo">
<cfthread name="thr#local.pageNo#" threadIndex="#local.pageNo#" action="run">
<cfif local.pageNo GT 1>
<cfhttp url="#local.apiURL#&page=#local.pageNo#" method="get" result="local.myResults" >
</cfhttp>
<cfset local.myResponse = deserializejson(local.myResults.filecontent)>
</cfif>
<cfloop from="1" to="#arrayLen(local.myResponse.result)#" index="i">
<cfset local.apartmentList = listAppend(local.apartmentList,local.myResponse.result[i].id & '-0')>
</cfloop>
</cfthread>
</cfloop>
<cfthread action="join" name="thr1,thr2,thr3,thr4,thr5"/>
I'm expecting local.apartmentList to be a big list of ID's but it returns empty. It's almost as if the code inside the thread is just being skipped. Can anybody spot what i'm doing wrong?