Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class GotoFsm extends Actor with FSM[Int, Null] {
- notifying {
- case Transition(_, 10) => println("Goto 10 ftw!")
- }
- when(0) {
- case _ => goto(10) until 5000
- }
- when(10) {
- case _ => stop
- }
- startWith(0, null)
- onTermination {
- case _ => println("Bye bye :-)")
- }
- }
- case object Go
- object GotoFsm {
- def main(args: Array[String]) {
- val gotoFsm = Actor.actorOf[GotoFsm].start
- gotoFsm !! Go
- }
- }
Add Comment
Please, Sign In to add comment