title: How do you get an object associated with a Future Actor?
body: <p>I would like to be able to get access to the object that is being returned from spawning a future</p>
  
  <pre><code>import scala.actors.Future
  import scala.actors.Futures._
  
  class Object1(i:Int) {
      def getAValue(): Int = {i}
  }
  
  object Test {
      def main( args: Array[String] ) = {
          var tests = List[Future[Object1]]()
          for(i &lt;- 0 until 10) {
              val test = future {
                  val obj1 = new Object1(i)
                  println("Processing " + i + "...")
                  Thread.sleep(1000)
                  println("Processed " + i)
                  obj1
              }
              tests = tests ::: List(test)
          }
          val timeout = 1000 * 60 * 5  // wait up to 5 minutes
          val futureTests = awaitAll(timeout,tests: _*)
  
          futureTests.foreach(test =&gt; println("result: " + future()))
      }
  }
  </code></pre>
  
  <p>The output from one run of this code is:</p>
  
  <pre><code>Processing 0...
  Processing 1...
  Processing 2...
  Processing 3...
  Processed 0
  Processing 4...
  Processed 1
  Processing 5...
  Processed 2
  Processing 6...
  Processed 3
  Processing 7...
  Processed 4
  Processing 8...
  Processed 6
  Processing 9...
  Processed 5
  Processed 7
  Processed 8
  Processed 9
  result: &lt;function0&gt;
  result: &lt;function0&gt;
  result: &lt;function0&gt;
  result: &lt;function0&gt;
  result: &lt;function0&gt;
  result: &lt;function0&gt;
  result: &lt;function0&gt;
  result: &lt;function0&gt;
  result: &lt;function0&gt;
  result: &lt;function0&gt;
  </code></pre>
  
  <p>I've tried future().getClass(), and the output is</p>
  
  <pre><code>result: class scala.actors.FutureActor
  </code></pre>
  
  <p>What I'm looking to be able to access is the obj1 objects.</p>
  
  <p>Thanks</p>
  
  <p>Bruce</p>