Class ReactiveLock
java.lang.Object
com.couchbase.client.core.transaction.util.ReactiveLock
A mutex pessimistic lock, compatible with reactive.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
isLocked()
reactor.core.publisher.Mono
<ReactiveLock.Waiter> 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 unlockedreactor.core.publisher.Mono
<Void> unlock
(ReactiveLock.Waiter waiter) The thing currently waiting on this lock is now unlocking it.reactor.core.publisher.Mono
<Void> unlock
(ReactiveLock.Waiter waiter, String extraDbg) reactor.core.publisher.Mono
<Void> 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
public reactor.core.publisher.Mono<Void> unlock(ReactiveLock.Waiter waiter, @Nullable String extraDbg) -
unlock
public reactor.core.publisher.Mono<Void> unlock(ReactiveLock.Waiter waiter, @Nullable String extraDbg, boolean removeFromWaiters) -
debugAsSingleThreaded
public boolean debugAsSingleThreaded() -
isLocked
public boolean isLocked()
-