Skip to content

Instantly share code, notes, and snippets.

@objcode
Forked from williamsjj/gist:881801
Created March 23, 2011 16:35
Show Gist options
  • Save objcode/883411 to your computer and use it in GitHub Desktop.
Save objcode/883411 to your computer and use it in GitHub Desktop.
class CachingInterface (object):
def __init__(self):
"To be overridden by the sub-class."
raise Exception("not implemented")
def store(key, value, type='post'):
"""
Store a key/value pair in the cache. Returns a Deferred.
Arguments:
key (string) - Key to store value under.
value (dictionary, list) - Value to be stored.
type (string) - update type
Returns:
Immediate Return: Twisted Deferred
Eventual Return:
* Success: True
* Failure: Raises an exception.
"""
raise Exception("not implemented")
def get(key):
"""
Retrieve a key/value pair from the cache.
Arguments:
key (string) - Key to retrieve value for.
Returns:
Immediate Return: Twisted Deferred
Eventual Return:
* Success: (dictionary, list) Key's value
* Failure: Raises an exception.
"""
raise Exception("not implemented")
def delete(key):
"""
Remove a key/value pair from the cache.
Arguments:
key (string) - Key to retrieve value for.
Returns:
Immediate Return: Twisted Deferred
Eventual Return:
* Success: True
* Failure: Raises an exception
"""
raise Exception("not implemented")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment