com.andy.idempotent.lock.DistributedLockService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of idempotent Show documentation
Show all versions of idempotent Show documentation
A simple idempotent component that addresses the prevention of duplicate submissions, duplicate notifications, and duplicate transaction compensation.
package com.andy.idempotent.lock;
/**
* 分布式锁接口
* @author andy
*
*/
public interface DistributedLockService {
public T doWithLock(String bizLockName,LockCallback lockCallback);
public interface LockCallback{
/**
* 锁定期间用户要执行的业务逻辑
* @throws Throwable
*/
public T doBiz() throws Throwable;
}
}