Creating client is simple as:
// Create Jedis Client
val poolConfig = GenericObjectPoolConfig<Connection>()
val client = JedisPooled(poolConfig, "localhost", 6379, 100)
Creating lock:
// Create lock
val lock = LockFactory.createSimplifiedMutex(client)
lock.lock("myResource", Duration.ofSeconds(1))
// do something
lock.unlock("myResource")
// Create Jedis Client
var poolConfig = new GenericObjectPoolConfig<Connection>();
var client = new JedisPooled(poolConfig, "localhost", 6381, 100);
Creating lock:
// Create lock
var lock = LockFactory.createSimplifiedMutex(client, Duration.ofSeconds(1), 3);
lock.lock("myResource", Duration.ofSeconds(1));
// do something
lock.unlock("myResource");