An open API service indexing awesome lists of open source software.

https://github.com/abelaska/jedis-lock

Jedis distributed lock support
https://github.com/abelaska/jedis-lock

Last synced: about 1 month ago
JSON representation

Jedis distributed lock support

Awesome Lists containing this project

README

          

# Jedis-lock

Jedis-lock is easy to use and simple implementation of distributed lock using Redis database and Jedis driver.

## How do I use it?

You can download the latests build at:
http://github.com/abelaska/jedis-lock/downloads

Or use it as a maven dependency:


com.github.jedis-lock
jedis-lock
1.0.0
jar
compile

To use it just:

Jedis jedis = new Jedis("localhost");
JedisLock lock = new JedisLock(jedis, "lockname", 10000, 30000);
lock.acquire();
try {
// do some stuff
}
finally {
lock.release();
}

That's it.

## License

The Apache Software License, Version 2.0