Permalink
Browse files

Added expire function.

  • Loading branch information...
1 parent 2934b44 commit dfd4e43295381b83c760b7d778434a2125560af3 petro-rudenko committed Dec 8, 2011
Showing with 7 additions and 0 deletions.
  1. +7 −0 redish/client.py
View
@@ -189,6 +189,13 @@ def get(self, key, default=None):
return self[key]
except KeyError:
return default
+
+ def expire(self, key, seconds):
+ """Set a key's time to live in seconds.
+ Returns: 1 if the timeout was set.
+ 0 if key does not exist or the timeout could not be set.
+ """
+ return self.api.expire(key, seconds)
def __getitem__(self, name):
"""``x.__getitem__(name) <==> x[name]``"""

0 comments on commit dfd4e43

Please sign in to comment.