title: Scala actors smart routing
body: <p>I need to execute some (let's say 10) tasks with less (i.e.) 3 actors.</p>
  
  <p>But I don't want to distribute all the tasks in the beginning, because time of execution may vary. That's why I need to send all of them 1 task and when any finishes he'll be given a new task. This way when first task takes 3 seconds and rest only ~ 0.5s job can be done in 3 sec.</p>
  
  <p>Having 10 tasks list:</p>
  
  <pre><code>(() =&gt; Thread.sleep(3000); println("done long"}) :: (1..9).map({() =&gt; println("done short")})
  </code></pre>
  
  <p>I want to have output:</p>
  
  <pre><code>done short
  done short
  done short
  done short
  done short
  done short
  done short
  done short
  done short
  done long
  </code></pre>
  
  <p>I could write the manager actor, returning actors to manager and redistributing the work again, but I was hoping to find a fixed solution in Scala or Akka.</p>