This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Groovy and the fly likes Tips for coding a lengthy operation  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Languages » Groovy
Bookmark "Tips for coding a lengthy operation  " Watch "Tips for coding a lengthy operation  " New topic
Author

Tips for coding a lengthy operation

Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3476

Hey,
In our application, we have to send a SMS (and even emails) to hundreds of users.
Since this operation could be lengthy, what is the best approach to code it?
I mean, should I embed it into a thread (all the code will be in Grails service)?
Should I launch it via Ajax in order not to hijack the UI?
Your corrections and suggestions are more than welcome.
Thanks for help and time.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

A couple of ways I might implement this are to either use quartz (there's a plugin) and schedule the task or I might just use a old school cron job. I'd say your main concern is not allowing this task to be kicked off more than once at a time by multiple users.


GenRocket - Experts at Building Test Data
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Tips for coding a lengthy operation
 
Similar Threads
Help me with a Simple HelloWorld.jsp
Event dispatch thread
Any performance tips ?
Run Java code ----- Online
Question type