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:
commit
4de2751a2d
2 changed files with 6 additions and 4 deletions
|
|
@ -148,8 +148,8 @@ object BackoffSupervisor {
|
||||||
* message to this actor and it will reply with [[akka.pattern.BackoffSupervisor.CurrentChild]]
|
* message to this actor and it will reply with [[akka.pattern.BackoffSupervisor.CurrentChild]]
|
||||||
* containing the `ActorRef` of the current child, if any.
|
* containing the `ActorRef` of the current child, if any.
|
||||||
*
|
*
|
||||||
* The `BackoffSupervisor` forwards all messages from the child to the parent of the
|
* The `BackoffSupervisor`delegates all messages from the child to the parent of the
|
||||||
* `BackoffSupervisor`.
|
* `BackoffSupervisor`, with the supervisor as sender.
|
||||||
*
|
*
|
||||||
* The `BackoffSupervisor` forwards all other messages to the child, if it is currently running.
|
* The `BackoffSupervisor` forwards all other messages to the child, if it is currently running.
|
||||||
*
|
*
|
||||||
|
|
@ -211,7 +211,8 @@ final class BackoffSupervisor(
|
||||||
sender() ! CurrentChild(child)
|
sender() ! CurrentChild(child)
|
||||||
|
|
||||||
case msg if child.contains(sender()) ⇒
|
case msg if child.contains(sender()) ⇒
|
||||||
context.parent.forward(msg)
|
// use the BackoffSupervisor as sender
|
||||||
|
context.parent ! msg
|
||||||
|
|
||||||
case msg ⇒ child match {
|
case msg ⇒ child match {
|
||||||
case Some(c) ⇒ c.forward(msg)
|
case Some(c) ⇒ c.forward(msg)
|
||||||
|
|
|
||||||
|
|
@ -195,7 +195,8 @@ class TransparentExponentialBackoffSupervisor(
|
||||||
log.debug(s"Terminating, because child [$childRef] terminated itself")
|
log.debug(s"Terminating, because child [$childRef] terminated itself")
|
||||||
stop(self)
|
stop(self)
|
||||||
case msg if sender() == childRef ⇒
|
case msg if sender() == childRef ⇒
|
||||||
parent.forward(msg)
|
// use the supervisor as sender
|
||||||
|
context.parent ! msg
|
||||||
case msg ⇒
|
case msg ⇒
|
||||||
childRef.forward(msg)
|
childRef.forward(msg)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue