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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal CompletableFuture<Void>runAsyncIfLeader(String lockName, Runnable runnable) final CompletableFuture<Void>runAsyncIfLeader(String lockName, Runnable runnable, Executor executor) final voidrunIfLeader(String lockName, Runnable runnable) final <T> CompletableFuture<T>supplyAsyncIfLeader(String lockName, Supplier<T> supplier) final <T> CompletableFuture<T>supplyAsyncIfLeader(String lockName, Supplier<T> supplier, Executor executor) final <T> TsupplyIfLeader(String lockName, Supplier<T> supplier)
-
Constructor Details
-
RedisLeaderElection
public RedisLeaderElection(org.redisson.api.RedissonClient redissonClient)
-
-
Method Details
-
runAsyncIfLeader
- Specified by:
runAsyncIfLeaderin interfacede.otto.synapse.leaderelection.LeaderElection
-
runAsyncIfLeader
public final CompletableFuture<Void> runAsyncIfLeader(String lockName, Runnable runnable, Executor executor) - Specified by:
runAsyncIfLeaderin interfacede.otto.synapse.leaderelection.LeaderElection
-
supplyAsyncIfLeader
- Specified by:
supplyAsyncIfLeaderin interfacede.otto.synapse.leaderelection.LeaderElection
-
supplyAsyncIfLeader
public final <T> CompletableFuture<T> supplyAsyncIfLeader(String lockName, Supplier<T> supplier, Executor executor) - Specified by:
supplyAsyncIfLeaderin interfacede.otto.synapse.leaderelection.LeaderElection
-
runIfLeader
- Specified by:
runIfLeaderin interfacede.otto.synapse.leaderelection.LeaderElection
-
supplyIfLeader
- Specified by:
supplyIfLeaderin interfacede.otto.synapse.leaderelection.LeaderElection
-