-
-
Notifications
You must be signed in to change notification settings - Fork 29
Description
Hi,
I'm looking for a mechanism to persist / restore interpreter state.
My current approach is to persist Interpreter._configuration to database. To restore it I instantiate Interpreter wit a restored initial context, then set _configuration obtained from database. Of course, persisting _memory would be needed too if using history states.
Obviously, I'm using an non public API by accessing/restoring Interpreter._configuration directly.
This worked well until 1.3. It breaks with sismic 1.4 because of the TimedContextEvaluator which has it's own copy of the states _configuration. Since I don't restore it, it starts with an empty _configuration and it breaks when exiting state at
Line 72 in b2f0708
| self._configuration.remove(event.state) |
Pickle is not an option for us for many reasons, mostly because it does not lend itself to data migration (if we evolve the state machine, it is possible to update _configuration during data migration, while updating a pickle is not practical).
So I'd like to discuss if pausing a state machine by persisting it to database makes sense as a use case for Sismic? If yes, what could be a stable API for persisting/restoring interpreter state?