Class ReactiveLock

java.lang.Object
com.couchbase.client.core.transaction.util.ReactiveLock

@Internal public class ReactiveLock extends Object
A mutex pessimistic lock, compatible with reactive.
  • Constructor Details

  • Method Details

    • 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()