com.jiangkedev.lock.DistributedLock Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of service-base Show documentation
Show all versions of service-base Show documentation
a common utils for spring boot project
The newest version!
package com.jiangkedev.lock;
/**DistributedLock.java 顶级接口
* @author jiangke
* @date 22:18
*/
public interface DistributedLock {
long TIMEOUT_MILLIS = 30000;
int RETRY_TIMES = Integer.MAX_VALUE;
long SLEEP_MILLIS = 500;
boolean lock(String key);
boolean lock(String key,int retryTimes);
boolean lock(String key,int retryTimes,long sleepMillis);
boolean lock(String key,long expire);
boolean lock(String key,long expire,int retryTimes);
boolean lock(String key, long expire, int retryTime, long sleepMillis);
boolean releaseLock(String key);
}