I am migrating to the latest couchbase .net library and I am looking for RequestMutexAsync in it. Does 3.x library has RequestMutexAsync method?
@Lal_John That method is supplied by the Couchbase.Extensions.Locks package. Unfortunately, this package has not been updated to be compatible with SDK 3.x yet. It’s on my list when I find some extra time :). That said, if you need it to work immediately the source code is available: https://github.com/couchbaselabs/Couchbase.Extensions/tree/master/src/Couchbase.Extensions.Locks
Thanks for the information.
GetAndLockAsync() does this can use as a workaround for mutex lock
Be careful, GetAndLockAsync isn’t exactly a mutex. It is only a write lock, and not a read lock. The lock also always expires, so if your task is long running you’ll need to keep renewing it (something the mutex logic does for you). Depending on your needs it may work, just a warning.
In case you’re interested, I’ve completed the work to update Locks to 3.x. It’ll be a bit before it’s fully reviewed, merged, and released on Nuget.org. However, in the interim, you could build it from source if it helps you.