Provide an interface for modules to use that enables them to temporarily serialize arbitrary data that will be restored upon being reloaded. This would allow modules to maintain runtime state and values that aren't written to disk.
In particular, modules making use of "cooldowns" like Chat, Quote, and Magic 8-Ball would benefit from this.
Brainstorming
For serialization, pickle would probably be the best choice, as the serialized data would only ever exist in memory, and its binary format would consume less space than JSON.
Store the serialized format in a dict in Core, mapping module identifiers to the serialized data.
Of course, it must be stored somewhere outside the feature module, since it gets reloaded.
What should happen to the serialized data if the module fails to reload?
Do some tests and see if module state survives on a failed reload
If it does, then just discard the data
If not, then see if there's any way to try and restore the data
Provide an interface for modules to use that enables them to temporarily serialize arbitrary data that will be restored upon being reloaded. This would allow modules to maintain runtime state and values that aren't written to disk.
In particular, modules making use of "cooldowns" like Chat, Quote, and Magic 8-Ball would benefit from this.
Brainstorming
pickle
would probably be the best choice, as the serialized data would only ever exist in memory, and its binary format would consume less space than JSON.Core
, mapping module identifiers to the serialized data.