roc230 / spymemcached

Automatically exported from code.google.com/p/spymemcached
0 stars 0 forks source link

Need asyncIncr with Default. #119

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I know from http://code.google.com/p/spymemcached/issues/detail?id=12 that
this is probably gonna be hairy, but I'd like to put in my vote for this
functionality.

Original issue reported on code.google.com by nelz9999@gmail.com on 19 Feb 2010 at 11:30

GoogleCodeExporter commented 9 years ago
I've added this functionality into my local git repository.  However, it is 
indeed difficult because passing back the secondary async set operation when a 
mutate fails is hairy.  In my case, I discard the return operation anyway so it 
works fine.  Two functions similar to the current methods in 
MemcachedClient.java were added: asyncMutateWithDefault and the corresponding 
asyncIncrWithDefault call.  

Maybe this feature could be implemented with the caveat that the user doesn't 
get a return value back?

Original comment by youngma...@gmail.com on 25 Oct 2011 at 9:32

GoogleCodeExporter commented 9 years ago
Also another way to get around it is to do a combination of add/asyncincr.  
However, not sure how the asynchronous operations are serialized, so this might 
result in a race condition.  In practice, it seems to add little overhead to 
the update process and works well.

Original comment by youngma...@gmail.com on 3 Nov 2011 at 12:48

GoogleCodeExporter commented 9 years ago
@youngmaeng do you believe your change is something we should incoporate?  
async operations are handled in order, but the possibility of a race is still 
there because there are plenty of other nodes

Not identifying a release timeframe at this time.

Original comment by ingen...@gmail.com on 3 Nov 2011 at 8:28