sealed trait State
import scala.concurrent.duration._
import akka.actor._

sealed trait Data
case object Initial extends State
case object Waiting extends State
case object Empty extends Data

class FSMActor extends LoggingFSM[State, Data] {
      startWith(Initial, Empty)
     
      when(Initial) {
        case Event("Wait", _) => goto(Waiting)
      }

      when(Waiting, stateTimeout = 5.seconds) {
        case Event("Message", _) => println(self.path.name + " got message")
        stay() forMax (Duration.Inf)

        case Event(StateTimeout, _) => println(self.path.name + " got 
StateTimeout :("); stay()
      }
}

val system = ActorSystem("system")
val fsm = system.actorOf(Props(new FSMActor), "fsm")
fsm ! "Wait"
fsm ! "Message"


(code on lpaste: http://lpaste.net/130078)

But actor keeps receiving StateTimeout messages

I'm using 2.4-SNAPSHOT, and before Apr 02 update, StateTimeout wasn't fired 
even without `forMax` in stay() clause.

Maybe the problem lays in my understanding of stateTimeout argument? Should 
I use setStateTimeout or something?

Thanks in advance.

-- 
>>>>>>>>>>      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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to