Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not work with pipeline if extend Redis #32

Closed
guileen opened this issue Apr 21, 2010 · 2 comments
Closed

not work with pipeline if extend Redis #32

guileen opened this issue Apr 21, 2010 · 2 comments

Comments

@guileen
Copy link

guileen commented Apr 21, 2010

Pipeline extends Redis, If I want to write a subclass extends Redis ,add some new method just like set_obj,get_obj in my own serialization, the pipeline should not work with these method. Because it extends Redis not my subclass.

Should pipeline be a embedded executor ?

Any good ideas?

@andymccurdy
Copy link
Contributor

What's an embedded executor?

Multiple Inheritance could probably solve your problem fairly easily.

class MyCustomRedisClass(redis.Redis):
    # ... your custom methods ...
    def pipeline(self, transaction=True):
        return MyCustomRedisPipeline(self.connection, transaction, self.encoding, self.errors)

class MyCustomRedisPipeline(MyCustomRedisClass, redis.Pipeline):
    pass

@guileen
Copy link
Author

guileen commented Apr 24, 2010

thanks a lot.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants