Actors (Scala)

http://www.scala-lang.org/node/242

object Stop
class Server extends Actor { def act() {
    var running = true;
    while (running) { receive {
        case x : Int => println(x)
        case Stop => running = false; } } } }
var s = new Server()
s.start ; s ! 42 ; s ! Stop



Johannes Waldmann 2011-06-29