com.sinszm.sofa.lock.RedisLock Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of szm-sofa-boot-starter-jedis Show documentation
Show all versions of szm-sofa-boot-starter-jedis Show documentation
高可用服务框架,Jedis缓存操作组件 Copyright © 2021 智慧程序猿(sinsz.com) All rights reserved.
The newest version!
package com.sinszm.sofa.lock;
/**
* 分布式任务锁
*
* @author fh411
*/
public interface RedisLock {
/**
* 加锁
*
* @param key 关键
* @param requestId 请求id
* @param expiresTime 到期时间,精度秒
* @return boolean
*/
boolean lock(String key, String requestId, int expiresTime);
/**
* 释放锁
*
* @param key 关键
* @param requestId 请求id
* @return boolean
*/
boolean releaseLock(String key, String requestId);
}