Source

dogpile.cache-dict-config / dogpile / cache / backends / memcached.py

Diff from to

dogpile/cache/backends/memcached.py

         self.memcached_expire_time = arguments.get(
                                         'memcached_expire_time', 0)
 
-        backend = self
-        class ClientPool(util.threading.local):
-            def __init__(self):
-                self.memcached = backend._create_client()
-
-        self._clients = ClientPool()
-
-
     def _imports(self):
         """client library imports go here."""
         raise NotImplementedError()
         """Creation of a Client instance goes here."""
         raise NotImplementedError()
 
+    @util.memoized_property
+    def _clients(self):
+        backend = self
+        class ClientPool(util.threading.local):
+            def __init__(self):
+                self.memcached = backend._create_client()
+
+        return ClientPool()
+
     @property
     def client(self):
         """Return the memcached client.