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

Missing redisService.memoizeObject() method #34

Closed
mrnohr opened this issue May 28, 2014 · 4 comments · Fixed by #36
Closed

Missing redisService.memoizeObject() method #34

mrnohr opened this issue May 28, 2014 · 4 comments · Fixed by #36

Comments

@mrnohr
Copy link

mrnohr commented May 28, 2014

There is a @MemoizeObject annotation used to memoize simple (non-domain) classes. However, there is not a corresponding redisService.memoizeObject() method.

I really am looking for a way to memoize objects against different redis servers. I was hoping to be able to do something like:

redisServiceCache.memoizeObject("key", [expire: 3600, clazz: MyObject.class])

An alternative would be to allow the redis server from the annotation.

@tednaleid
Copy link
Contributor

@mrnohr I want to make sure that I'm understanding what you're asking for. How I understand what you're saying is that you've got multiple distinct redis instances (so not clustered together) and you want to use the annotations (which by default just go at the "main" redisService) against those other connections instead of the default one. Ones that you can get spring injected into your Grails services with names like redisServiceCache.

Alternatively, if the @MemoizeObject annotation had the corresponding memoizeObject method, you could make that work by just doing that inside your methods with the proper injected connection, but you'd prefer to use the annotation?

@tednaleid
Copy link
Contributor

It felt like a miss to not have RedisService.memoizeObject and it turned out to be pretty simple to implement (I wasn't the one that originally did the @MemoizeObject annotation). Hopefully this fits with what you were looking for. It'll be in the next release of the plugin.

tednaleid added a commit that referenced this issue May 29, 2014
…Object

Issue #34 service missing memoize object
@mrnohr
Copy link
Author

mrnohr commented May 29, 2014

Just for completion in the history, I'll answer @tednaleid 's questions. Yes, my intent was to have multiple redis instances and be able to use the memoizeObject method. This was so I could scale up to use different redis servers for different types of objects.

Currently I am using the @MemoizeObject annotation, but with this change I can now switch to using the new memoizeObject method.

This fix will be a big help!

@jmulhern
Copy link
Contributor

Looks good @tednaleid !

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

Successfully merging a pull request may close this issue.

3 participants