Interface ClusteredLock


public interface ClusteredLock
ClusteredLock is a data structure used for concurrent programming between Infinispan instances in cluster mode. A typical usage idiom for lock() will be : ClusteredLock lock = clm.get("lock"); lock.lock() .thenRun(() -> try { // manipulate protected state } finally { return lock.unlock(); } ) A typical usage idiom for tryLock() will be : lock.tryLock() .thenCompose(result -> { if (result) { try { // manipulate protected state } finally { return lock.unlock(); } } else { // Do something else } });
Since:
9.2
Author:
Katia Aresti, [email protected]
See Also: