added auto shutdown of "spawn"

This commit is contained in:
Jonas Bonér 2010-02-19 13:45:18 +01:00
parent 398bff0142
commit e361b9de5d

View file

@ -141,8 +141,7 @@ object Actor extends Logging {
start
send(Spawn)
def receive = {
case Spawn => body
case _ => throw new IllegalArgumentException("Actors created with 'actor(body: => Unit)' do not respond to messages.")
case Spawn => body; stop
}
}
}