Skip navigation links
reactor-locks
B C E F I L M P Q R S T U W 

B

begin(Mono<T>) - Static method in interface party.iroiro.lock.Lock
Transforming a Mono into LockedMono.LockedMonoBuilder for uses with its fluent API
BroadcastingLock - Class in party.iroiro.lock
An implementation of Lock by internally broadcasting releasing events.
BroadcastingLock() - Constructor for class party.iroiro.lock.BroadcastingLock
 

C

cancel() - Method in interface party.iroiro.lock.LockHandle
Attempts to cancels a lock request
cancel() - Method in class party.iroiro.lock.LockHandle.CancellableHandle
 
cancel() - Method in class party.iroiro.lock.util.EmptySink
Tries to emit a LockCancellationException to a subscriber

E

emit() - Method in class party.iroiro.lock.util.EmptySink
Tries to emit SignalType.ON_COMPLETE signal to a subscriber
emitAny(ConcurrentLinkedQueue<Sinks.Empty<Void>>) - Static method in class party.iroiro.lock.util.SinkUtils
 
emitAnySink(ConcurrentLinkedQueue<EmptySink>) - Static method in class party.iroiro.lock.util.SinkUtils
 
emitEmpty(Sinks.Empty<Void>) - Static method in class party.iroiro.lock.util.SinkUtils
 
emitError(Sinks.Empty<Void>) - Static method in class party.iroiro.lock.util.SinkUtils
 
empty() - Static method in interface party.iroiro.lock.LockHandle
 
EmptySink - Class in party.iroiro.lock.util
A simple Sinks.Empty-like implementation
EmptySink() - Constructor for class party.iroiro.lock.util.EmptySink
 

F

flatMap(Function<T, Mono<S>>) - Method in class party.iroiro.lock.LockedMono.LockedMonoBuilder
Calling Mono.flatMap(Function) of the internal mono, with the lock held
from(Mono<Void>, Supplier<Boolean>) - Static method in interface party.iroiro.lock.LockHandle
 

I

instance() - Static method in exception party.iroiro.lock.util.LockCancellationException
Returns a static instance of the exception
isLocked() - Method in class party.iroiro.lock.BroadcastingLock
 
isLocked() - Method in interface party.iroiro.lock.Lock
Checks whether this lock is locked (or has reached the max lock holders)
isLocked() - Method in class party.iroiro.lock.ReactiveLock
 
isLocked() - Method in class party.iroiro.lock.ReactiveRWLock
 
isLocked() - Method in class party.iroiro.lock.ReactiveSemaphore
 
isRLocked() - Method in class party.iroiro.lock.ReactiveRWLock
 
isRLocked() - Method in interface party.iroiro.lock.RWLock
Checks whether this lock is reader-locked (or has reached the max lock holders)

L

Lock - Interface in party.iroiro.lock
A reactive interface for simple locks (and probably semaphores)
lock() - Method in interface party.iroiro.lock.Lock
Deprecated.
Use Lock.withLock(Supplier) to handle cancelling signals

Usage:


     Lock lock = new ReactiveLock(); /* Or other locks */
     mono
         .flatMap(t -> lock.lock().thenReturn(t))
         /* Some processing */
         .transform(lock::unlockOnNext)
         .block();
 

The underlying implementation should automatically queue the Mono up if the lock is not available.

Do not use Mono.timeout(Duration) or Mono.timeout(Publisher), which are not handled at all. Use Lock.tryLock(Duration) or Lock.tryLock() instead if you want timeouts.

LockCancellationException - Exception in party.iroiro.lock.util
An empty exception signifying the cancellation of a lock request
LockCancellationException() - Constructor for exception party.iroiro.lock.util.LockCancellationException
 
LockedMono<R> - Class in party.iroiro.lock
A class providing Mono-like API to build instructions in locked scopes
LockedMono.LockedMonoBuilder<T> - Class in party.iroiro.lock
A simple builder for fluent locking API
LockHandle - Interface in party.iroiro.lock
A lock handle (including a Mono to listen to and a canceller function).
LockHandle.CancellableHandle - Class in party.iroiro.lock
 
lockOnNext(Mono<T>) - Method in interface party.iroiro.lock.Lock
Deprecated.
Use Lock.withLock(Supplier) to handle cancelling signals

Usage:


     Lock lock = new ReactiveLock(); /* Or other locks */
     mono
         .transform(lock::lockOnNext)
         /* Some processing */
         .transform(lock::unlockOnNext)
         .block();
 

The underlying implementation should automatically queue the Mono up if the lock is not available.

When the lock becomes available, the value will be automatically propagated downstream.

M

map(Function<T, S>) - Method in class party.iroiro.lock.LockedMono.LockedMonoBuilder
Calling Mono.map(Function) of the internal mono, with the lock held
mono() - Method in class party.iroiro.lock.LockHandle.CancellableHandle
 
mono() - Method in interface party.iroiro.lock.LockHandle
Returns a Mono that emits success only after acquiring the lock
mono() - Method in class party.iroiro.lock.util.EmptySink
 

P

party.iroiro.lock - package party.iroiro.lock
Reactive lock interfaces, i.e., Lock and RWLock, and implementations.
party.iroiro.lock.util - package party.iroiro.lock.util
 

Q

queue(ConcurrentLinkedQueue<Sinks.Empty<Void>>, Function<Sinks.Empty<Void>, Boolean>) - Static method in class party.iroiro.lock.util.SinkUtils
Creates a Sinks.Empty, offer it to the queue, and make a Mono which emits success after the sink is filled.
queueSink(ConcurrentLinkedQueue<EmptySink>) - Static method in class party.iroiro.lock.util.SinkUtils
 

R

ReactiveLock - Class in party.iroiro.lock
A lock implementation using mainly CAS operations to synchronize
ReactiveLock() - Constructor for class party.iroiro.lock.ReactiveLock
Creates an unfair lock
ReactiveLock(boolean) - Constructor for class party.iroiro.lock.ReactiveLock
Creates an instance of CasLock with the given fairness policy
ReactiveRWLock - Class in party.iroiro.lock
An implementation RWLock.
ReactiveRWLock() - Constructor for class party.iroiro.lock.ReactiveRWLock
 
ReactiveSemaphore - Class in party.iroiro.lock
An implementation of Lock that allows multiple lock holders with an upper limit (that is, it is the reactive version of Semaphore).
ReactiveSemaphore(int) - Constructor for class party.iroiro.lock.ReactiveSemaphore
Creates a reactive semaphore with the given upper limit
rLock() - Method in interface party.iroiro.lock.RWLock
Deprecated.
Use withRLock(Supplier) to handle cancelling signals

The difference is that the underlying implementation might choose to implement a Readers–writer lock.

Do not use Mono.timeout(Duration) or Mono.timeout(Publisher), which are not handled at all. Use tryRLock(Duration) or tryRLock() instead if you want timeouts.

rLockOnNext(Mono<T>) - Method in interface party.iroiro.lock.RWLock
Deprecated.
Use withRLock(Supplier) to handle cancelling signals

The difference is that the underlying implementation might choose to implement a Readers–writer lock.

rUnlock() - Method in class party.iroiro.lock.ReactiveRWLock
 
rUnlock() - Method in interface party.iroiro.lock.RWLock
See Lock.unlock() for details.
rUnlockOnEmpty(Mono<T>) - Method in interface party.iroiro.lock.RWLock
Deprecated.
Use withRLock(Supplier) to handle cancelling signals
rUnlockOnError(Mono<T>) - Method in interface party.iroiro.lock.RWLock
Deprecated.
Use withRLock(Supplier) to handle cancelling signals
rUnlockOnNext(Mono<T>) - Method in interface party.iroiro.lock.RWLock
Deprecated.
Use withRLock(Supplier) to handle cancelling signals
rUnlockOnTerminate(Mono<T>) - Method in interface party.iroiro.lock.RWLock
Deprecated.
Use withRLock(Supplier) to handle cancelling signals
RWLock - Interface in party.iroiro.lock
A reactive interface for reader–writer locks.

S

SinkUtils - Class in party.iroiro.lock.util
 
subscribe(Subscriber<? super Void>) - Method in class party.iroiro.lock.util.EmptySink
 

T

tryLock() - Method in class party.iroiro.lock.BroadcastingLock
 
tryLock() - Method in interface party.iroiro.lock.Lock
Immediately requests to hold the lock.
tryLock(Duration) - Method in interface party.iroiro.lock.Lock
Deprecated.
Use Lock.withLock(Supplier) to handle cancelling signals
tryLock() - Method in class party.iroiro.lock.ReactiveLock
 
tryLock() - Method in class party.iroiro.lock.ReactiveRWLock
 
tryLock() - Method in class party.iroiro.lock.ReactiveSemaphore
 
tryRLock() - Method in class party.iroiro.lock.ReactiveRWLock
 
tryRLock() - Method in interface party.iroiro.lock.RWLock
The reader lock equivalent to Lock.tryLock()
tryRLock(Duration) - Method in interface party.iroiro.lock.RWLock
Deprecated.
Use Lock.withLock(Supplier) to handle cancelling signals

U

unlock() - Method in class party.iroiro.lock.BroadcastingLock
 
unlock() - Method in interface party.iroiro.lock.Lock
Unlocks
unlock() - Method in class party.iroiro.lock.ReactiveLock
 
unlock() - Method in class party.iroiro.lock.ReactiveRWLock
 
unlock() - Method in class party.iroiro.lock.ReactiveSemaphore
 
unlockOnEmpty(Mono<T>) - Method in interface party.iroiro.lock.Lock
Deprecated.
Use Lock.withLock(Supplier) to handle cancelling signals

Usage:


     Lock lock = new ReactiveLock(); /* Or other locks */
     mono
         .transform(lock::lockOnNext)
         /* Some processing */
         .transform(lock::unlockOnEmpty)
         .block();
 

Using Mono.switchIfEmpty(Mono) to ensure the execution order and handling of an empty Mono.

unlockOnError(Mono<T>) - Method in interface party.iroiro.lock.Lock
Deprecated.
Use Lock.withLock(Supplier) to handle cancelling signals

Usage:


     Lock lock = new ReactiveLock(); /* Or other locks */
     mono
         .transform(lock::lockOnNext)
         /* Some processing */
         .transform(lock::unlockOnError)
         .block();
 

Using Mono.doOnError(Consumer) to ensure the execution order and handling of Monos with an error.

unlockOnNext(Mono<T>) - Method in interface party.iroiro.lock.Lock
Deprecated.
Use Lock.withLock(Supplier) to handle cancelling signals

Usage:


     Lock lock = new ReactiveLock(); /* Or other locks */
     mono
         .transform(lock::lockOnNext)
         /* Some processing */
         .transform(lock::unlockOnNext)
         .block();
 

Using Mono.doOnNext(Consumer) to ensure the execution order and handling of a successful Mono with a emitted value.

unlockOnTerminate(Mono<T>) - Method in interface party.iroiro.lock.Lock
Deprecated.
Use Lock.withLock(Supplier) to handle cancelling signals

Usage:


     Lock lock = new ReactiveLock(); /* Or other locks */
     mono
         .transform(lock::lockOnNext)
         /* Some processing */
         .transform(lock::unlockOnTerminate)
         .block();
 

Using Mono.doOnTerminate(Runnable) to ensure the execution order and handling of all cases, including an empty Mono, a successful Mono with a emitted value or Monos with an error.

W

with(Lock) - Method in class party.iroiro.lock.LockedMono.LockedMonoBuilder
Transforms the builder into a Mono, with previous transformations gathered into the lock scope with Lock.withLock(Supplier)
withLock(Supplier<Publisher<T>>) - Method in interface party.iroiro.lock.Lock
Automatically acquires the lock, executes the function and unlocks.
withR(RWLock) - Method in class party.iroiro.lock.LockedMono.LockedMonoBuilder
Transforms the builder into a Mono, with previous transformations gathered into the lock scope with withRLock(Supplier)
withRLock(Supplier<Publisher<T>>) - Method in interface party.iroiro.lock.RWLock
The reader lock version of Lock.withLock(Supplier).
B C E F I L M P Q R S T U W 
Skip navigation links
reactor-locks