mikee47 / ConfigDB

Configuration database for Sming
GNU General Public License v3.0
3 stars 1 forks source link

Support asynchronous serialisation and de-serialisation #11

Closed mikee47 closed 3 months ago

mikee47 commented 3 months ago

This PR decouples serialisation and de-serialisation from the Store by delegating to the Database instance. This allows applications to control behaviour using custom Database class implementations.

The Store objects are no longer virtual and are purely for managing in-memory data contents. There are no longer implementation-specific store types, and serialisation and de-serialisation is instead handled via Reader and Writer class implementations.

These classes provide methods to support both immediate (synchronous) streaming (e.g. to/from files) and for asychronous streaming to/from web clients.

Serialisation still uses an internal MemoryDataStream intermediate buffer, but instead of buffering the entire contents of a store much smaller fragments are created. For the Basic_Config example this maxes out at about 120 bytes.