Class RedisLeaderElection

java.lang.Object
de.otto.synapse.leaderelection.redis.RedisLeaderElection
All Implemented Interfaces:
de.otto.synapse.leaderelection.LeaderElection

@Beta public class RedisLeaderElection extends Object implements de.otto.synapse.leaderelection.LeaderElection
  • Constructor Details

    • RedisLeaderElection

      public RedisLeaderElection(org.redisson.api.RedissonClient redissonClient)
  • Method Details

    • runAsyncIfLeader

      public final CompletableFuture<Void> runAsyncIfLeader(String lockName, Runnable runnable)
      Specified by:
      runAsyncIfLeader in interface de.otto.synapse.leaderelection.LeaderElection
    • runAsyncIfLeader

      public final CompletableFuture<Void> runAsyncIfLeader(String lockName, Runnable runnable, Executor executor)
      Specified by:
      runAsyncIfLeader in interface de.otto.synapse.leaderelection.LeaderElection
    • supplyAsyncIfLeader

      public final <T> CompletableFuture<T> supplyAsyncIfLeader(String lockName, Supplier<T> supplier)
      Specified by:
      supplyAsyncIfLeader in interface de.otto.synapse.leaderelection.LeaderElection
    • supplyAsyncIfLeader

      public final <T> CompletableFuture<T> supplyAsyncIfLeader(String lockName, Supplier<T> supplier, Executor executor)
      Specified by:
      supplyAsyncIfLeader in interface de.otto.synapse.leaderelection.LeaderElection
    • runIfLeader

      public final void runIfLeader(String lockName, Runnable runnable)
      Specified by:
      runIfLeader in interface de.otto.synapse.leaderelection.LeaderElection
    • supplyIfLeader

      public final <T> T supplyIfLeader(String lockName, Supplier<T> supplier)
      Specified by:
      supplyIfLeader in interface de.otto.synapse.leaderelection.LeaderElection