#3166 - Adding parenthesis to FSM.initialize
This commit is contained in:
parent
88f7e28c6b
commit
48c0b3aa2c
10 changed files with 12 additions and 14 deletions
|
|
@ -91,7 +91,7 @@ object FSMActorSpec {
|
||||||
}
|
}
|
||||||
|
|
||||||
// initialize the lock
|
// initialize the lock
|
||||||
initialize
|
initialize()
|
||||||
|
|
||||||
private def doLock() {
|
private def doLock() {
|
||||||
lockedLatch.open
|
lockedLatch.open
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ object FSMTransitionSpec {
|
||||||
whenUnhandled {
|
whenUnhandled {
|
||||||
case Event("reply", _) ⇒ stay replying "reply"
|
case Event("reply", _) ⇒ stay replying "reply"
|
||||||
}
|
}
|
||||||
initialize
|
initialize()
|
||||||
override def preRestart(reason: Throwable, msg: Option[Any]) { target ! "restarted" }
|
override def preRestart(reason: Throwable, msg: Option[Any]) { target ! "restarted" }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -698,8 +698,7 @@ object SupervisorHierarchySpec {
|
||||||
stop
|
stop
|
||||||
}
|
}
|
||||||
|
|
||||||
initialize
|
initialize()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -451,7 +451,7 @@ trait FSM[S, D] extends Listeners with ActorLogging {
|
||||||
* Verify existence of initial state and setup timers. This should be the
|
* Verify existence of initial state and setup timers. This should be the
|
||||||
* last call within the constructor.
|
* last call within the constructor.
|
||||||
*/
|
*/
|
||||||
final def initialize: Unit = makeTransition(currentState)
|
final def initialize(): Unit = makeTransition(currentState)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return current state name (i.e. object of type S)
|
* Return current state name (i.e. object of type S)
|
||||||
|
|
|
||||||
|
|
@ -276,7 +276,7 @@ class TimerBasedThrottler(var rate: Rate) extends Actor with Throttler with FSM[
|
||||||
case Active -> Idle ⇒ stopTimer()
|
case Active -> Idle ⇒ stopTimer()
|
||||||
}
|
}
|
||||||
|
|
||||||
initialize
|
initialize()
|
||||||
|
|
||||||
private def startTimer(rate: Rate) = setTimer("morePermits", Tick, rate.duration, true)
|
private def startTimer(rate: Rate) = setTimer("morePermits", Tick, rate.duration, true)
|
||||||
private def stopTimer() = cancelTimer("morePermits")
|
private def stopTimer() = cancelTimer("morePermits")
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ class FSMDocSpec extends MyFavoriteTestFrameWorkPlusAkkaTestKit {
|
||||||
//#unhandled-elided
|
//#unhandled-elided
|
||||||
//#fsm-body
|
//#fsm-body
|
||||||
|
|
||||||
initialize
|
initialize()
|
||||||
}
|
}
|
||||||
//#simple-fsm
|
//#simple-fsm
|
||||||
object DemoCode {
|
object DemoCode {
|
||||||
|
|
|
||||||
|
|
@ -336,7 +336,7 @@ private[akka] class ServerFSM(val controller: ActorRef, val channel: Channel) ex
|
||||||
stay
|
stay
|
||||||
}
|
}
|
||||||
|
|
||||||
initialize
|
initialize()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -574,7 +574,7 @@ private[akka] class BarrierCoordinator extends Actor with LoggingFSM[BarrierCoor
|
||||||
throw BarrierTimeout(d)
|
throw BarrierTimeout(d)
|
||||||
}
|
}
|
||||||
|
|
||||||
initialize
|
initialize()
|
||||||
|
|
||||||
def handleBarrier(data: Data): State = {
|
def handleBarrier(data: Data): State = {
|
||||||
log.debug("handleBarrier({})", data)
|
log.debug("handleBarrier({})", data)
|
||||||
|
|
|
||||||
|
|
@ -257,8 +257,7 @@ private[akka] class ClientFSM(name: RoleName, controllerAddr: InetSocketAddress)
|
||||||
channel.close()
|
channel.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
initialize
|
initialize()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ abstract class GenericBuncher[A: ClassTag, B](val singleTimeout: FiniteDuration,
|
||||||
stop
|
stop
|
||||||
}
|
}
|
||||||
|
|
||||||
initialize
|
initialize()
|
||||||
}
|
}
|
||||||
|
|
||||||
object Buncher {
|
object Buncher {
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ class Chopstick extends Actor with FSM[ChopstickState, TakenBy] {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialze the chopstick
|
// Initialze the chopstick
|
||||||
initialize
|
initialize()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -155,7 +155,7 @@ class FSMHakker(name: String, left: ActorRef, right: ActorRef) extends Actor wit
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize the hakker
|
// Initialize the hakker
|
||||||
initialize
|
initialize()
|
||||||
|
|
||||||
private def startThinking(duration: FiniteDuration): State = {
|
private def startThinking(duration: FiniteDuration): State = {
|
||||||
goto(Thinking) using TakenChopsticks(None, None) forMax duration
|
goto(Thinking) using TakenChopsticks(None, None) forMax duration
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue