All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sinszm.sofa.lock.RedisLock Maven / Gradle / Ivy

Go to download

高可用服务框架,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);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy