added auto shutdown of "spawn"

This commit is contained in:
Jonas Bonér 2010-02-19 13:45:18 +01:00
parent 421e87b8d9
commit 4e8611f4ed

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
}
}
}