Update README.rst

This commit is contained in:
Shay Palachy
2016-08-29 00:32:03 +03:00
committed by GitHub
parent 8e758f1e4f
commit b72c16003e
+4
View File
@@ -77,6 +77,10 @@ You can set any duration as the shelf life of cached return values of a function
@cachier(stale_after=datetime.timedelta(weeks=2))
def bar(arg1, arg2):
return {'arg1': arg1, 'arg2': arg2}
Now when a cached value matching the given arguments is found the time of its calculation is checked; if more than ``stale_after`` time has since passed the function will be run again for the same arguments and the new value will be cached and returned.
This is usefull for lengthy calculation that depend on a dynamic data source.
Fuzzy Shelf Live
~~~~~~~~~~~~~~~~