simplify the stopping example, #28144 (#29760)

* need for the callback variant should be a rare so we should not
  confuse the users with it in this example
* mention of callback in api docs should be enough
This commit is contained in:
Patrik Nordwall 2020-10-27 17:27:43 +01:00 committed by GitHub
parent 592b1d10ad
commit 8d25ca2012
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 22 deletions

View file

@ -165,8 +165,6 @@ A child actor can be forced to stop after it finishes processing its current mes
All child actors will be stopped when their parent is stopped.
When an actor is stopped, it receives the `PostStop` signal that can be used for cleaning up resources.
A callback function may be specified as parameter to `Behaviors.stopped` to handle the `PostStop` signal
when stopping gracefully. This allows to apply different actions when it is stopped abruptly.
Here is an illustrating example:
@ -175,7 +173,6 @@ Scala
#imports
#master-actor
#worker-actor
#graceful-shutdown
}
Java
@ -183,7 +180,6 @@ Java
#imports
#master-actor
#worker-actor
#graceful-shutdown
}
When cleaning up resources from `PostStop` you should also consider doing the same for the `PreRestart` signal,