Skip to content

Latest commit

 

History

History
33 lines (30 loc) · 854 Bytes

README.md

File metadata and controls

33 lines (30 loc) · 854 Bytes

It's a Jedis client implementation of RedPulsar library

Getting started

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")

Getting started with Java

// 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");