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

Support for multiple redis endpoints #8

Closed
ctoestreich opened this issue Apr 25, 2012 · 2 comments
Closed

Support for multiple redis endpoints #8

ctoestreich opened this issue Apr 25, 2012 · 2 comments

Comments

@ctoestreich
Copy link
Contributor

There is a request to add the ability to configure multiple endpoints. I will fork and add a simple configuration mechanism for the time being to support this via the withRedis method taking a connection param.

@tednaleid
Copy link
Contributor

Thanks @ctoestreich. I haven't had a chance to look at things in detail, but would this also support using different databases within the same redis endpoint? (redis databases are numbered). Would each have it's own pool with this?

I think that'd be ok and people have asked for that.

I'm assuming you would still configure the "main" endpoint through the normal config, and this just creates other db connections outside of that? All calls not going through this would go through the "main" connection, right?

As a potential future enhancement, it'd be cool if there was the ability to have some parent class define a closure that picks a pool with something like groovy's use and all redis conections done within the scope of that closure delegate to that endpoint rather than the default endpoint.

@ctoestreich
Copy link
Contributor Author

That sounds like a great next step. I will look into it a bit. I think the issue I am facing now is whether to extend the ability to use the connections into all the service methods. For the time being I think i am going to leave it on just withRedis, withPipeline and withTransaction. We should have some more discussion around how to make this extensible.

I like your idea of something like use but I am not exactly sure the best way to impl something like that. We could extend the configuration block to allow multiple endpoints to be setup and have some mechanism to select which one or more endpoints to use in a call to redis. That might be tricky as we would have to denote the "default" connection somehow.

For now since this is probably a one-off request, leaving it simple and explicit is probably okay.

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