Merge pull request #19027 from akka/wip-19016-BackoffSupervisor-passivation-patriknw

=act #19016 use the BackoffSupervisor as sender for parent msg
This commit is contained in:
Patrik Nordwall 2015-11-27 10:48:30 +01:00
commit 4de2751a2d
2 changed files with 6 additions and 4 deletions

View file

@ -148,8 +148,8 @@ object BackoffSupervisor {
* message to this actor and it will reply with [[akka.pattern.BackoffSupervisor.CurrentChild]]
* containing the `ActorRef` of the current child, if any.
*
* The `BackoffSupervisor` forwards all messages from the child to the parent of the
* `BackoffSupervisor`.
* The `BackoffSupervisor`delegates all messages from the child to the parent of the
* `BackoffSupervisor`, with the supervisor as sender.
*
* The `BackoffSupervisor` forwards all other messages to the child, if it is currently running.
*
@ -211,7 +211,8 @@ final class BackoffSupervisor(
sender() ! CurrentChild(child)
case msg if child.contains(sender())
context.parent.forward(msg)
// use the BackoffSupervisor as sender
context.parent ! msg
case msg child match {
case Some(c) c.forward(msg)

View file

@ -195,7 +195,8 @@ class TransparentExponentialBackoffSupervisor(
log.debug(s"Terminating, because child [$childRef] terminated itself")
stop(self)
case msg if sender() == childRef
parent.forward(msg)
// use the supervisor as sender
context.parent ! msg
case msg
childRef.forward(msg)
}