Watch in the wrong place
This commit is contained in:
parent
6d722cc313
commit
a2329e7c8e
1 changed files with 1 additions and 1 deletions
|
|
@ -49,10 +49,10 @@ object TypedSample {
|
||||||
children.get(name) match {
|
children.get(name) match {
|
||||||
case Some(ref) =>
|
case Some(ref) =>
|
||||||
ref ! childCommand
|
ref ! childCommand
|
||||||
context.watchWith(ref, ChildTerminated(name))
|
|
||||||
Behaviors.same
|
Behaviors.same
|
||||||
case None =>
|
case None =>
|
||||||
val ref = context.spawn(Child(), name)
|
val ref = context.spawn(Child(), name)
|
||||||
|
context.watchWith(ref, ChildTerminated(name))
|
||||||
ref ! childCommand
|
ref ! childCommand
|
||||||
updated(children + (name -> ref))
|
updated(children + (name -> ref))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue