armonic/armonic — pull request #2 by eonpatapon (2014-04-03 13:36:37+00:00)
Title: Improve persistance API

Any XMLRessource can persist after the agent is shut down. Just set _persist
to True and implement two methods:

class Ressource(XMLRessource):
_persist = True

def _persist_primitive(self):
"""On stop return state primitive that will be saved."""
return ...

def _persist_load_primitive(self, primitive):
"""On start logic that restore ressource state from the
primitive."""
...

Running the agent with -s will _not_ save ressources states on exit. Running
the agent with -l will _not_ load ressources states on start.