Conversation
|
Have we looked at cachetools? |
|
cachetools.Cache does a lot more than this new class - because it's not composable - and also a lot less, for the exact same reason. Technically speaking, Everything else that zict allows - namely,
both of which are key features here, cachetools does not do. |
fjetter
left a comment
There was a problem hiding this comment.
I think we should briefly talk about naming but otherwise this looks good!
| cache: MutableMapping | ||
| Fast cache for reads from data. This mapping may lose keys on its own; e.g. it | ||
| could be a LRU. | ||
| update_on_set: bool, optional |
There was a problem hiding this comment.
Do you have an example where update_on_set=False is helpful?
There was a problem hiding this comment.
Not in distributed.
It boils down to the temporal locality patterns of the library user. Sometimes writing a key/value pair does not imply likelihood that the same key will be read back sooner than the rest.
For example, somebody may write the output of a nightly backup batch job to s3fs or some other very slow filesystem; being a backup, 9 times out of 10 nobody is going to read it back. When people do want to read it back though, they are very likely to access the same files multiple times (assuming the backup is not just dumped back on top of live).
zict/cache.py
Outdated
|
|
||
| else: | ||
|
|
||
| class WeakRefCache(weakref.WeakValueDictionary): |
There was a problem hiding this comment.
It is a bit confusing having the Cache and WeakRefCache classes in here although WeakRefCache is not a Cache. Maybe one of the classes should be renamed?
There was a problem hiding this comment.
Maybe this one should be called WeakValueMapping to stick to zict nomenclature?
|
Guessing the conflicts are related to PR ( #66 )? |
|
fixed conflicts |
Uh oh!
There was an error while loading. Please reload this page.