The key to me was the discovery that every Scala object (?) Is an implicit actor, so you can use Actor.react{ } to block. Here is my source code:
import scala.actors._ import scala.actors.Actor._
Typical results are as follows:
scala ActorsNoSpin.scala progressReporter awaiting news... All actors started... Starting Agent 1 with timeout 2500 Starting Agent 5 with timeout 1500 Starting Agent 3 with timeout 1500 Starting Agent 4 with timeout 1495 Starting Agent 6 with timeout 5000 Starting Agent 0 with timeout 2000 4 finished, sending results progressReporter received a completed signal Query result from agent 4 Received Query result from agent 4 after 1499 ms Among the first to finish was : Query result from agent 4 5 finished, sending results 3 finished, sending results 0 finished, sending results 1 finished, sending results 6 finished, sending results
source share