BTW, if you `import org.fusesource.hawtdispatch._` then you can use
the scala enriched interfaces for DispatchQueue so you can reduce your
example down to:
import org.fusesource.hawtdispatch._
import java.util.concurrent.CountDownLatch
object HawtDispatchTest {
def main(args: Array[String]) {
val latch = new CountDownLatch(100)
val test = Dispatch.createQueue("test")
for (i <- 0 until 100) {
test {
println("run job " + i.toString + " on thread: " +
Thread.currentThread().toString)
latch.countDown()
}
println("submitted job: " + i.toString)
}
latch.await()
println("finished...exiting")
}
}
Regards,
Hiram
FuseSource
Web: http://fusesource.com/