added auto shutdown of "spawn"
This commit is contained in:
parent
421e87b8d9
commit
4e8611f4ed
1 changed files with 1 additions and 2 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue