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 setnx in RedisShardingAPI #11

Closed
jhorman opened this issue Feb 18, 2011 · 2 comments
Closed

Support setnx in RedisShardingAPI #11

jhorman opened this issue Feb 18, 2011 · 2 comments

Comments

@jhorman
Copy link

jhorman commented Feb 18, 2011

Is there a reason why setnx isn't supported in the sharding api? It seems like it could/should be. Wasn't sure if there was a reason why it wouldn't work.

@fiorix
Copy link
Collaborator

fiorix commented Feb 18, 2011

Yes it should work fine.. maybe we just forgot to add that to the list of supported methods for sharding. I just added, please give it a try and let us know.
Thanks!

@jhorman
Copy link
Author

jhorman commented Feb 23, 2011

Thanks.

The more I look at the api the more I think you shouldn't restrict the methods callable from the RedisShardingAPI. Since you support the bracket syntax for extracting the token to use to lookup the node, I am able to use most redis api calls effectively.

Even calls like RPOPLPUSH which could get confusing can be done.

RPOPLPUSH(queue, backupqueue)

This would be a problem if you assumed you could now do a

RPOP(backupqueue)

and find the item since backupqueue hashes differently.

Except instead you can do

RPOPLPUSH(queue-{queue}, backupqueue-{queue})

I guess my preference is to allow developers to shoot themselves in the foot, but give them some warnings.

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