Hello!
I need to store a value, provided the data under its key has not been modified in the DB since the value was read, and be sure the new value is persisted/replicated to a certain number of nodes. For modification check, I’d like to utilize optimistic locking, i.e. CAS methods. I need to synchronously wait until persistence/replication of the value is successful.
Problem is that .NET SDK provides methods to specify either a CAS value or durability requirements:
ExecuteCas(mode, key, value, validfor, cas);
ExecuteStore(mode, key, value, persistTo, replicateTo);
I need to combine both. There is also Observe method:
Observe(key, cas, persistTo, replicateTo);
but seems that it is not documented. So, particularly, I can’t be sure if the method waits for the value to be persisted/replicated or just checks that at the moment of the call.