I replaced `*Duration.Inf*` with `*1.minute*`:
# begins in the Initial state
scala> fsm ! "Message"
currentState.stateName: Initial
nextState.notifies: true
currentState.timeout: None
stateTimeouts(currentState.stateName): Some(5 seconds)
# Now it's in the Waiting state
fsm got message
currentState.stateName: Waiting
nextState.notifies: false
currentState.timeout: Some(1 minute)
stateTimeouts(currentState.stateName): Some(5 seconds)
# but, then the timeout is set to None somewhere
scala> fsm got StateTimeout :(
currentState.stateName: Waiting
nextState.notifies: false
currentState.timeout: None
stateTimeouts(currentState.stateName): Some(5 seconds)
fsm got StateTimeout :(
# and it resumes with the 5 seconds
currentState.stateName: Waiting
nextState.notifies: false
currentState.timeout: None
stateTimeouts(currentState.stateName): Some(5 seconds)
Would it be worthwhile for `forMax` to update the mutable *stateTimeouts*
map?
So, the new `forMax` would look like:
def forMax(timeout: Duration): State[S, D] = timeout match {
case f: FiniteDuration ⇒ copy(timeout = Some(f));
stateTimeouts(currentState.stateName) = f
case _ ⇒ copy(timeout = None);
stateTimeouts.remove(currentState.stateName)
}
Does that make sense?
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.