예제 #1
0
 def set(self, key, value):
     namespace = self._namespace()
     key = self._key(key)
     value = pack(value)
     # PKUNK 9502 change method hset to setex
     self._client.setex(name='%s:%s' % (namespace, key),
                        value=value,
                        time=self.duration)
예제 #2
0
 def set(self, key, value, ttl=None):
     if ttl:
         assert isinstance(ttl, int)
     namespace = self._namespace()
     key = self._key(key)
     value = pack(value)
     self._client.setex(name='%s:%s' % (namespace, key),
                        value=value,
                        time=ttl or self._ttl)
예제 #3
0
파일: cache.py 프로젝트: mpaulmier/trytond
 def set(self, key, value):
     super(SerializableMemoryCache, self).set(key, pack(value))
예제 #4
0
 def set(self, key, value):
     namespace = self._namespace()
     key = self._key(key)
     value = pack(value)
     self._client.hset(namespace, key, value)