Sleep and pause a ColdFusion or Java thread

I find this really useful sometimes. for example when we did the Geocoding of Australian Postcodes I chucked in a sleep thread to the loop so that we wouldn’t hammer google and get banned from running any more geocoding requests. This uses the java.lang.Thread method to pause or sleep the currently running thread. So first […]
May 13, 2007 8:01 pm

I find this really useful sometimes. for example when we did the Geocoding of Australian Postcodes I chucked in a sleep thread to the loop so that we wouldn’t hammer google and get banned from running any more geocoding requests. This uses the java.lang.Thread method to pause or sleep the currently running thread.

So first we create the object in ColdFusion using the createObject() tag. Then use the .sleep method that is available on a thread object to ask it to sleep for a period of milliseconds we pass in.

Leave a Comment

Login
Log in below to access your courses.
Log In With Google
Forgot Password
Enter your email address or username and we’ll send you instructions to reset your password.