fix CTD vs. RepointableRef by swallowing exceptions during send

- it was always intended that tell() (and sendSystemMessage()) shall not
  throw any exceptions
- this is implemented by swallowing in ActorCell
  (suspend/resume/restart/stop/!/sendSystemMessage) and in
  RemoteActorRef (!/sendSystemMessage)
- current implementation uses a normal method, which adds overhead but
  keeps the code in one place (ActorCell.catchingSend); this is a great
  opportunity for making use of macros
This commit is contained in:
Roland 2012-08-15 21:46:05 +02:00
parent f7ea9bf3dd
commit c1c05ef95e
8 changed files with 43 additions and 28 deletions

View file

@ -229,9 +229,11 @@ private[akka] class RemoteActorRef private[akka] (
def isTerminated: Boolean = !running
def sendSystemMessage(message: SystemMessage): Unit = remote.send(message, None, this)
def sendSystemMessage(message: SystemMessage): Unit =
ActorCell.catchingSend(remote.system, path.toString, classOf[RemoteActorRef], remote.send(message, None, this))
override def !(message: Any)(implicit sender: ActorRef = null): Unit = remote.send(message, Option(sender), this)
override def !(message: Any)(implicit sender: ActorRef = null): Unit =
ActorCell.catchingSend(remote.system, path.toString, classOf[RemoteActorRef], remote.send(message, Option(sender), this))
def suspend(): Unit = sendSystemMessage(Suspend())