类 DistributedLockHandler

java.lang.Object
com.aizuda.easy.retry.server.job.task.support.handler.DistributedLockHandler

@Component public class DistributedLockHandler extends Object
分布式锁工具类
从以下版本开始:
: 2.6.0
  • 构造器详细资料

    • DistributedLockHandler

      public DistributedLockHandler()
  • 方法详细资料

    • lockWithDisposableAndRetry

      public void lockWithDisposableAndRetry(LockExecutor lockExecutor, String lockName, Duration lockAtMost, Duration sleepTime, Integer maxRetryTimes)
      获取分布式锁并支持重试
      参数:
      lockExecutor - 执行器
      lockName - 锁名称
      lockAtMost - 锁超时时间
      sleepTime - 重试间隔
      maxRetryTimes - 重试次数
    • lockWithDisposable

      public void lockWithDisposable(LockExecutor lockExecutor, String lockName, Duration lockAtMost)
      获取分布式锁
      参数:
      lockExecutor - 执行器
      lockName - 锁名称
      lockAtMost - 锁超时时间