title: Grails quartz->thread
body: <p>This is my Trigger that calls a matchService...</p>
  
  <pre><code>    class TestJob { 
       def matchService
  
   static triggers = {
  
    cron name: 'firstThread',  cronExpression: "0 0/1 12-13 ? * THU"
    }
  
   def group = "threadGroup"
  
  
      def execute() {
    matchService.playMatch()
    println "run thread: " + String.format('%tH:%&lt;tM:%&lt;tS.%&lt;tL',System.currentTimeMillis())
      }
  }
  </code></pre>
  
  <p>...this is the service that is called</p>
  
  <pre><code>class MatchException extends RuntimeException {
   String message
   Match match
  }
  
  
  class MatchService {
  
       /*
        * Rolls back database changes if errors occur
        */
       static transactional = true
  
       public void calc(Match m) {
        println m.teamH.name + " - " + m.teamA.name
       }
  
       public playMatch() {
  
        List&lt;Match&gt; matchList = new ArrayList()
  
        Cal.get(1).matches.each{
         match -&gt;
          matchList.add(match)
        }
  
  
      for(Match m: matchList) {
         if(!m.validate()) {
          throw new MatchException( message: "match not valid!!" , match:m)
         }
          calc(m)
      }
     }
   }
  </code></pre>
  
  <p>what I'd like to do is to call the method calc N times in N threads to run synchronized.
  Is it also possible to update a gsp page in real time (without refresh the browser) with the new changes?
  Anybody can help me?</p>