Details
-
Improvement
-
Resolution: Won't Do
-
Minor
-
None
-
None
-
Security Level: Public
-
None
Description
In the (now being deprecated in favor of the gocb SDK) go-couchbase library, there is an interesting semantic for retrying a mutation transparently if CAS doesn't match:
you provide a callback that, given the bytes of the document, mutates the document content as you'd like, and the library will keep trying to apply this mutation if the CAS doesn't match by fetching the latest version and retrying the callback.
You need a mean of interrupting this loop either through a configurable "max tries" parameters or conditionally based on the doc's content from inside the callback.
This could be interesting to explore this idea and implement it in other SDKs like the Java SDK.