-
Notifications
You must be signed in to change notification settings - Fork 85
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
Add a CASStore trait #222
Comments
Sounds pretty cool. I believe redis can support it via its scripting API. But not sure of any other ones that could. (Scripts are executed atomically, so you could return key's for which the swap wasn't possible). |
I think this will work great with memcache if the locally cached tokens are usually going to be current. Redis doesn't use tokens for cas. Instead, it lets you "watch" the key for any updates by other threads while you try to make an update. The same applies to scripts as well I think. So we may not need a token there - http://redis.io/topics/transactions#cas Is there a way to model this trait for stores that do not use cas tokens? |
This seems to overlap with my (sadly abandoned) UpdateableStore PR, right? #119 |
Ah, yes. UpdateableStore sounds like the more appropriate place for redis updates. UpdateableStore was conceived for read-modify-writes. On the other hand, CASStore seems to be separating the three ( I can see a MemcacheUpdateableStore built on top of a MemcacheCASStore though. |
Having said that, +1 for the trait. |
something like:
With this, we can build a local cache of tokens and values and do Mergeable with 1 roundtrip, rather than 2 in Memcache etc..
Note, this does not put an Option on the returns. If missing values are allowed, use
Option[V]
.Question: does multiCas make sense? We can always add it, but how many systems can optimize it?
The text was updated successfully, but these errors were encountered: