i2mint / py2store

Tools to create simple and consistent interfaces to complicated and varied data sources.
MIT License
11 stars 2 forks source link

Extend existing write caching tools #48

Open thorwhalen opened 4 years ago

thorwhalen commented 4 years ago

We have mk_write_cached_store, but though quite general, it isn't completely, or at least doesn't cover some common cases without hacking.

Example: Flushing before new item is added to cache. This is need, for e.g. when we want to group data for a same key.

One general view is to provide a function that brings us from the (new_item, old_cache, old_persister)' state to a(new_cache, new_persister)` state. Obviously, though, we need to provide idioms for the common cases.