Dan Kenigsberg has posted comments on this change. Change subject: cache: Add caching decorator with invalidation ......................................................................
Patch Set 4: (2 comments) http://gerrit.ovirt.org/#/c/34709/4/lib/vdsm/cache.py File lib/vdsm/cache.py: Line 42: """ Line 43: Return a caching decorator supporting invalidation. Line 44: Line 45: The decorator accepts an optional "update" callable, called each time the Line 46: memoized function is called. If update() return True, the memoized cache is update() return True -> update() returns True Line 47: invalidated. If the update is not set, the cache is never invalidated. Line 48: Line 49: The memoized function may accept multiple positional arguments. The Line 50: cache store the result for each combination of arguments. Functions with Line 46: memoized function is called. If update() return True, the memoized cache is Line 47: invalidated. If the update is not set, the cache is never invalidated. Line 48: Line 49: The memoized function may accept multiple positional arguments. The Line 50: cache store the result for each combination of arguments. Functions with store->stores Line 51: kwargs are not supported. Line 52: Line 53: Memoized functions have an "invalidate" method, used to invalidate the Line 54: cache externally. This is required for testing memoized functions. -- 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: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer <nsof...@redhat.com> Gerrit-Reviewer: Adam Litke <ali...@redhat.com> Gerrit-Reviewer: Antoni Segura Puimedon <asegu...@redhat.com> Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com> Gerrit-Reviewer: Federico Simoncelli <fsimo...@redhat.com> Gerrit-Reviewer: Francesco Romani <from...@redhat.com> Gerrit-Reviewer: Martin Sivák <msi...@redhat.com> Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com> Gerrit-Reviewer: Saggi Mizrahi <smizr...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches