类 DistributedLockHandler
java.lang.Object
com.aizuda.easy.retry.server.job.task.support.handler.DistributedLockHandler
分布式锁工具类
- 从以下版本开始:
- : 2.6.0
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidlockWithDisposable(LockExecutor lockExecutor, String lockName, Duration lockAtMost) 获取分布式锁voidlockWithDisposableAndRetry(LockExecutor lockExecutor, String lockName, Duration lockAtMost, Duration sleepTime, Integer maxRetryTimes) 获取分布式锁并支持重试
-
构造器详细资料
-
DistributedLockHandler
public DistributedLockHandler()
-
-
方法详细资料
-
lockWithDisposableAndRetry
public void lockWithDisposableAndRetry(LockExecutor lockExecutor, String lockName, Duration lockAtMost, Duration sleepTime, Integer maxRetryTimes) 获取分布式锁并支持重试- 参数:
lockExecutor- 执行器lockName- 锁名称lockAtMost- 锁超时时间sleepTime- 重试间隔maxRetryTimes- 重试次数
-
lockWithDisposable
获取分布式锁- 参数:
lockExecutor- 执行器lockName- 锁名称lockAtMost- 锁超时时间
-