[CalendarServer-changes] [2471] CalendarServer/branches/unified-cache/twistedcaldav/cache.py
source_changes at macosforge.org
source_changes at macosforge.org
Fri May 23 17:14:55 PDT 2008
Revision: 2471
http://trac.macosforge.org/projects/calendarserver/changeset/2471
Author: dreid at apple.com
Date: 2008-05-23 17:14:54 -0700 (Fri, 23 May 2008)
Log Message:
-----------
Make connection a class attribute on the change notifier
Modified Paths:
--------------
CalendarServer/branches/unified-cache/twistedcaldav/cache.py
Modified: CalendarServer/branches/unified-cache/twistedcaldav/cache.py
===================================================================
--- CalendarServer/branches/unified-cache/twistedcaldav/cache.py 2008-05-23 23:52:26 UTC (rev 2470)
+++ CalendarServer/branches/unified-cache/twistedcaldav/cache.py 2008-05-24 00:14:54 UTC (rev 2471)
@@ -73,6 +73,8 @@
class MemcacheChangeNotifier(LoggingMixIn):
+ _memcacheProtocol = None
+
def __init__(self, propertyStore):
self._path = propertyStore.resource.fp.path
self._host = config.Memcached['BindAddress']
@@ -81,15 +83,13 @@
from twisted.internet import reactor
self._reactor = reactor
- self._memcacheProtocol = None
-
def _newCacheToken(self):
return str(uuid.uuid4())
def _getMemcacheProtocol(self):
- if self._memcacheProtocol is not None:
+ if MemcacheChangeNotifier._memcacheProtocol is not None:
return succeed(self._memcacheProtocol)
d = ClientCreator(self._reactor, MemCacheProtocol).connectTCP(
@@ -97,7 +97,7 @@
self._port)
def _cacheProtocol(proto):
- self._memcacheProtocol = proto
+ MemcacheChangeNotifier._memcacheProtocol = proto
return proto
return d.addCallback(_cacheProtocol)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20080523/625c6683/attachment.htm
More information about the calendarserver-changes
mailing list