summaryrefslogtreecommitdiff
path: root/kazoo/recipe/cache.py
diff options
context:
space:
mode:
Diffstat (limited to 'kazoo/recipe/cache.py')
-rw-r--r--kazoo/recipe/cache.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/kazoo/recipe/cache.py b/kazoo/recipe/cache.py
index 525154a..bf6b92f 100644
--- a/kazoo/recipe/cache.py
+++ b/kazoo/recipe/cache.py
@@ -62,6 +62,8 @@ class TreeCache(object):
"""
if self._state == self.STATE_LATENT:
self._state = self.STATE_STARTED
+ elif self._state == self.STATE_CLOSED:
+ raise KazooException('already closed')
else:
raise KazooException('already started')
@@ -77,6 +79,9 @@ class TreeCache(object):
A closed cache was detached from ZooKeeper's changes. And all nodes
will be invalidated.
+ Once a tree cache was closed, it could not be started again. You should
+ only close a tree cache while you want to recycle it.
+
.. note::
This method is not thread safe.