title: Queue asynchronous task in Play! - correct way
body: <p>I have a little Play! application(2.1, scala) which acts as a RESTful front-end for a Java library. This web app queues tasks for background processing using:</p>
  
  <pre><code>Akka.system.scheduler.scheduleOnce(Duration(0, SECONDS)) {
        new TaskWorker().run(batchId)
  }
  </code></pre>
  
  <p>in <code>Tasks</code> controller.</p>
  
  <p>The goal is to immediately start heavy processing by the Java library, but in the background.</p>
  
  <p>In advent of Scala 2.10 and its <a href="http://docs.scala-lang.org/sips/pending/futures-promises.html" rel="nofollow">futures and promises</a>, will it make more sense to refactor the queuing to leverage this new API?</p>
  
  <p>In general, I'm looking for a way to be able to perform background processing as currently implemented by <a href="https://github.com/defunkt/resque" rel="nofollow">Resque</a> Ruby library, but perhaps having an in-process memory queue.(Redis-backed queue would be fine too).</p>