Does a finite state machine where you can modify the events to cause any transition you want defeat the purpose of the FSM? It's interesting that while the states are limited, by adding code you can cause a transition from any state to any other. You can look at the pretty picture to understand the default FSM, but as soon as you install any additional code, you don't know what transitions it will take. Adding modules effectively rewrites the FSM.
Is that the intent?
Also, this reminds me a bit of the design behind Varnish.
Well, you can't cause any transition you want, you can just change the events in the stream. So, if you're in the middle of proxying you can get out of it and go into a handler, but you couldn't totally screw up the FSM and go someplace weird.
So, adding modules doesn't rewrite the FSM. You'd need Ragel and a C compiler for that. ;-)
Is that the intent?
Also, this reminds me a bit of the design behind Varnish.