title: How do I create a periodic Poller with Play 2.0 and Scala
body: <p>I want to create a periodic Poller which polls every x milliseconds something. </p>
  
  <p>I want to start and stop it via URL </p>
  
  <pre><code>val pollingActor = actor {
      var loop = true
      loopWhile(loop) {
        react {
          case "Stop" =&gt; {
            Console.println("Poller Stopping")
            loop = false
            exit
          }
          case "Start" =&gt; {
            Console.println("Poller Starting")
            loop = true
          }
        }
        pollMyResults() // this is my poller
      }
    }
  </code></pre>
  
  <p>but, this doesn#t work , the actor just gets called once, when i the start the poller with </p>
  
  <p>pollingActor ! "start"</p>
  
  <p>What am i doing wrong ? did i missunderstand the loop in the actor ? </p>