Saggi Mizrahi has posted comments on this change.
Change subject: cache: Add caching decorator with invalidation
......................................................................
Patch Set 2: Code-Review-1
(1 comment)
Please add: doc/infra/cache.rst
And make the content:
Cache
=============
.. automodule:: vdsm.infra.cache
:members:
Also, modify: doc/infra/index.rst
So it appropriately lists the new cache module.
Also, if you feel industrious, Add module docstring explaining how to create new
validators. But it's OK if you want to skip on that last thing.
Sorry for all the extra work but we are trying to get the infra documented and
discoverable so that new developers can quickly get a list of all the tools we provide.
http://gerrit.ovirt.org/#/c/34709/2/lib/vdsm/cache.py
File lib/vdsm/cache.py:
Line 22: import os
Line 23: import functools
Line 24:
Line 25:
Line 26: def memoized(update=None):
update_on looks nice when you define decorate:
I'm OK with
the compromise. It's a parameter so the context is always near.
In any case, you could have internally just do:
update = update_on
del update_on
Line 27: """
Line 28: Return a caching decorator supporting invalidation.
Line 29:
Line 30: The decorator accepts an optional "update" callable, called each
time the
--
To view, visit
http://gerrit.ovirt.org/34709
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I6dd8fb29d94286e3e3a3e29b8218501cbdc5c018
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes