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

Liking multiple items #88

Open
marcrohloff opened this issue Feb 21, 2014 · 3 comments
Open

Liking multiple items #88

marcrohloff opened this issue Feb 21, 2014 · 3 comments

Comments

@marcrohloff
Copy link

Is there an efficient way to like multiple items together? i.e. I am currently doing:
movies.each { |m| user.like(m) }
but of course there are lots of inefficiencies.

@davidcelis
Copy link
Owner

Not currently. I'd probably accept a PR to make the rating methods take a splatted list of items, though then handling the before/after hooks may end up getting tricky.

@marcrohloff
Copy link
Author

Fortunately I don't have after hooks though I agree that would make a generic solution tricky. The biggest problem would be triggering before/after blocks without triggering the before after But there a lot of requests to Redis could be pipelined and multiple calls to sadd and zadd could be coalesced in a few places. We'll have to watch performance and if it is warranted look into that PR.

@davidcelis
Copy link
Owner

Sounds good! Please let me know what you find!

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

No branches or pull requests

2 participants