RequestMutexAsync in couchbase .net client 3.x

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

3 Likes

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.

3 Likes

@Lal_John

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.

3 Likes

@btburnett3 when can we expect this in Nuget.org

@Lal_John unfortunately I’m a bit out of the loop on release schedules, since I’m an outside contributor I don’t have access to release things myself.

@jmorris I think you may be able to answer this question?

1 Like