Class ReactiveLock
java.lang.Object
com.couchbase.client.core.transaction.util.ReactiveLock
A mutex pessimistic lock, compatible with reactive.
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
isLocked()
if the lock is unlocked, lock it, and continue else if the lock is locked, join the list of things waiting for it to be unlockedunlock
(ReactiveLock.Waiter waiter) The thing currently waiting on this lock is now unlocking it.unlock
(ReactiveLock.Waiter waiter, String extraDbg) unlock
(ReactiveLock.Waiter waiter, String extraDbg, boolean removeFromWaiters)
-
Constructor Details
-
ReactiveLock
-
-
Method Details
-
lock
if the lock is unlocked, lock it, and continue else if the lock is locked, join the list of things waiting for it to be unlocked -
unlock
The thing currently waiting on this lock is now unlocking it. Let one (and only one) thing waiting on this lock, continue.It's reactive style as always need to do a .timeout() after it
-
unlock
-
unlock
public Mono<Void> unlock(ReactiveLock.Waiter waiter, @Nullable String extraDbg, boolean removeFromWaiters) -
debugAsSingleThreaded
public boolean debugAsSingleThreaded() -
isLocked
public boolean isLocked()
-