Added parens to unbecome

This commit is contained in:
Patrik Nordwall 2011-04-12 11:03:36 +02:00
parent 3c903ca077
commit 1f9d54dced
3 changed files with 5 additions and 5 deletions

View file

@ -119,7 +119,7 @@ class HotSwapSpec extends WordSpec with MustMatchers {
_log += "swapped" _log += "swapped"
barrier.await barrier.await
case "revert" => case "revert" =>
unbecome unbecome()
}) })
barrier.await barrier.await
} }

View file

@ -422,7 +422,7 @@ trait Actor {
* If "discardOld" is true, an unbecome will be issued prior to pushing the new behavior to the stack * If "discardOld" is true, an unbecome will be issued prior to pushing the new behavior to the stack
*/ */
def become(behavior: Receive, discardOld: Boolean = true) { def become(behavior: Receive, discardOld: Boolean = true) {
if (discardOld) unbecome if (discardOld) unbecome()
self.hotswap = self.hotswap.push(behavior) self.hotswap = self.hotswap.push(behavior)
} }
@ -454,7 +454,7 @@ trait Actor {
private final def autoReceiveMessage(msg: AutoReceivedMessage): Unit = msg match { private final def autoReceiveMessage(msg: AutoReceivedMessage): Unit = msg match {
case HotSwap(code, discardOld) => become(code(self), discardOld) case HotSwap(code, discardOld) => become(code(self), discardOld)
case RevertHotSwap => unbecome case RevertHotSwap => unbecome()
case Exit(dead, reason) => self.handleTrapExit(dead, reason) case Exit(dead, reason) => self.handleTrapExit(dead, reason)
case Link(child) => self.link(child) case Link(child) => self.link(child)
case Unlink(child) => self.unlink(child) case Unlink(child) => self.unlink(child)

View file

@ -473,7 +473,7 @@ Here is another little cute example of ``become`` and ``unbecome`` in action:
become { become {
case Swap => case Swap =>
println("Ho") println("Ho")
unbecome // resets the latest 'become' (just for fun) unbecome() // resets the latest 'become' (just for fun)
} }
} }
} }
@ -511,7 +511,7 @@ Revert the Actor body using the ``unbecome`` method:
.. code-block:: scala .. code-block:: scala
def receive: Receive = { def receive: Receive = {
case "revert" => unbecome case "revert" => unbecome()
} }
Killing an Actor Killing an Actor