fsm
fsm copied to clipboard
FSM persistance
Firstly, thank you for your work, this is really useful. I currently work on a project that needs a FSM (in fact many FSM). This FSMs are created and fed an event log read.
For a production use, we need to schedule some persistence of the FSMs in order to avoid reading the event log from start each time we restart the program.
My initial approach is to serialize data to persist (via encoding/gob for ex.) including FSMs. But the type FSM has no exported field that can be accessed by gob encoders.
So my question is : have you planned to add functions like (f *FSM) Save() []byte and (f *FSM) Load(backup []byte? Did you think this can be useful ?
Great input! Nothing planned in that area but a really good suggestion. Are you looking to load/save the state only or the full FSM?
I would suggest some more flexible output instead of bytes. Any other ideas for that?
Could be great if full FSM, but this could be tricky transition func... If we save only state, then to reload them we must create FSM with all definition (sates, transition funcs).
Hi, Is this feature in progress? We are making our app HA and wanted to see if there is any way to recover on crashes or share the FSM among multiple instances.