Skip to content   Subversion checkout URL  You can clone with
Download ZIP Branch: master   latest commit 3d114f8719 @aconbere
authored Failed to load latest commit information. src first
commit .gitignore first commit README.mkd readme build.sbt first
commit   Tiny State Machine Trait  This is a tiny state machine
with a single public method trigger, which takes an Event which
is an edge between two states, and will progress the current
state into the next.  More than anything this is an attempt to
put down on paper the pattern I'm using elsewhere.   Below I
will build a classic State Machine:  import
com.conbere.statemachine._  The "Turnstile" which has two
states:  case object Locked extends State case object UnLocked
extends State  When it's locked, the machine sit's waiting for
someone to feed it coins.  case class Coin(val value: Int)
extends Event  If the coins exceed the cost of the turnstile it
can be Pushed, the person can pass, and it will return to
Locked.  case object Push extends Event  Let's lo