-
-
Save objcode/883411 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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