I am using redisson reactive Java client. In non reactive client one could get an expirable Semaphore as:-
RPermitExpirableSemaphore semaphore = redisson.getPermitExpirableSemaphore("mySemaphore");
But If I create a reactive client, I can only find redisson.getSemaphore("value")
function. I need PermitExpirableSemaphore because:-
- I need a lock which could be released by different thread(so can't use
RLock
). - I need a lease timeout to prevent deadlock in case the lock aquiring thread is killed or stuck.
Is there any way to achieve this behavior in Redisson Distributed Locking?
Edit1: I can set lease time global in Config as:- Config().setLockWatchdogTimeout(leaseTimeMs)
, but I really need different leasetime at different locks.
Edit2: Asked a question on Redisson github at https://github.com/redisson/redisson/issues/1391