Skip to content

Abstract redis access to a seperate interface #2

Description

@kageurufu
class IdempotentStorageIterface(object):
    def get(self, key): pass
    def set(self, key): pass
    def atomic_set(self, key): pass
    def subscribe(self, key): pass
    def get_messages(self, timeout=None): pass
    def notify(self, key, message): pass
    def close(self): pass

atomic_set can be implemented in redis using NX {E,P}X

close should cleanly end any subscriptions, and close any sockets or connections that were created for this request. Pooling should be preferred over connect/close, and close should release the connection to the pool in that case. Redis uses StrictRedis.from_url which is a ConnectionPool instance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions