Class ReactiveLock
- java.lang.Object
-
- com.couchbase.client.core.transaction.util.ReactiveLock
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ReactiveLock.Waiter
-
Constructor Summary
Constructors Constructor Description ReactiveLock(CoreTransactionAttemptContext ctx, boolean debugMode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
debugAsSingleThreaded()
boolean
isLocked()
Mono<ReactiveLock.Waiter>
lock(String dbg, Duration timeout)
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 unlockedMono<Void>
unlock(ReactiveLock.Waiter waiter)
The thing currently waiting on this lock is now unlocking it.Mono<Void>
unlock(ReactiveLock.Waiter waiter, String extraDbg)
Mono<Void>
unlock(ReactiveLock.Waiter waiter, String extraDbg, boolean removeFromWaiters)
-
-
-
Constructor Detail
-
ReactiveLock
public ReactiveLock(CoreTransactionAttemptContext ctx, boolean debugMode)
-
-
Method Detail
-
lock
public Mono<ReactiveLock.Waiter> lock(String dbg, Duration timeout)
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
public Mono<Void> unlock(ReactiveLock.Waiter waiter)
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
public Mono<Void> unlock(ReactiveLock.Waiter waiter, @Nullable String extraDbg)
-
unlock
public Mono<Void> unlock(ReactiveLock.Waiter waiter, @Nullable String extraDbg, boolean removeFromWaiters)
-
debugAsSingleThreaded
public boolean debugAsSingleThreaded()
-
isLocked
public boolean isLocked()
-
-