At work I use state machines extensively in one of our applications. I’ve found state machines to be very powerful when working with messaging. They are especially useful when combined with event based processing, where an event comes in, the current state can process and move to the next state based on the data received.
People have made a few different Lua state machines but, they don’t work quite like I’d like. So I decided to write my own. I don’t necessarily have a use for it right now but, I’m sure at some point in the future I’ll be very happy to have this around.
Without further ado, I’d like to introduce lua-stater! While the README has a simple example of using the state machine the “test/tests” directory provides many example which demonstrate lua-stater’s capabilities.