From 88d2947330f9b3f73708d03c045d21ce2dc08e90 Mon Sep 17 00:00:00 2001 From: Shay Palachy Date: Mon, 29 Aug 2016 00:12:46 +0300 Subject: [PATCH] Update README.rst --- README.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.rst b/README.rst index 370cbfc..7ef7674 100644 --- a/README.rst +++ b/README.rst @@ -97,6 +97,16 @@ You can slightly optimize caching if you know your code will only be used in a s This will prevent reading the cache file on each cache read, speeding things up a bit, while also nullfying inter-thread functionality (the code is still thread safe, but different threads will have different version of the cache at times, and will sometime make unecessary function calls. +MongoDB-based Caching +~~~~~~~~~~~~~~~~~~~~~ +You can set a MongoDB-based cache by assigning ``mongetter`` with a callable that returns a ``pymongo.Collection`` object: + +.. code-block:: python + + @cachier(mongetter=False) + +This allows you to have a cross-machine cache, albeit slower. + .. links: .. _bson package: https://api.mongodb.com/python/current/api/bson/ .. _watchdog: https://github.com/gorakhargosh/watchdog