Skip to content

iamsahil1989/jedis-lock

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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:

<dependency>
    <groupId>com.github.jedis-lock</groupId>
    <artifactId>jedis-lock</artifactId>
    <version>1.0.0</version>
    <type>jar</type>
    <scope>compile</scope>
</dependency>

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

About

Jedis distributed lock support

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%