akka/akka-core

Compose matchState methods in AbstractFSM

Open

#17,718 opened on Jun 15, 2015

View on GitHub
 (1 comment) (0 reactions) (0 assignees)Scala (13,277 stars) (3,547 forks)batch import
1 - triagedhelp wantedt:core

Description

In scala version I can do this:

    onTransition {
      case _ -> State.Pausing => log.debug("Transitioning into pausing state")
      case _ -> State.Running => log.debug("Transitioning into running state")
    }

but in Java version using matchState method I can only one state transition

onTransition(
        matchState(GameEngineState.Running, GameEngineState.Pausing,
              () -> log().debug("Transitioning into pausing state")));

We would need a way to compose matchState methods.

Contributor guide