Merge pull request #28098 from johanandren/wip-TypedSample-fix

Watch in the wrong place in sample
This commit is contained in:
Patrik Nordwall 2019-11-05 15:46:16 +01:00 committed by GitHub
commit 5a309cc3d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -49,10 +49,10 @@ object TypedSample {
children.get(name) match {
case Some(ref) =>
ref ! childCommand
context.watchWith(ref, ChildTerminated(name))
Behaviors.same
case None =>
val ref = context.spawn(Child(), name)
context.watchWith(ref, ChildTerminated(name))
ref ! childCommand
updated(children + (name -> ref))
}