All Projects → coditory → sherlock-distributed-lock

coditory / sherlock-distributed-lock

Licence: Apache-2.0 license
Distributed locking library for JVM

Programming Languages

java
68154 projects - #9 most used programming language
groovy
2714 projects
kotlin
9241 projects

Projects that are alternatives of or similar to sherlock-distributed-lock

java-sdk
一些常用的java sdk和工具类(日期工具类,分布式锁,redis缓存,二叉树,反射工具类,线程池,对称/非对称/分段加解密,json序列化,http工具,雪花算法,字符串相似度,集合操作工具,xml解析,重试Retry工具类,Jvm监控等)
Stars: ✭ 26 (+52.94%)
Mutual labels:  jvm, distributed-lock
jellyfin-sdk-kotlin
Kotlin SDK for Jellyfin, supporting Android and JVM Targets
Stars: ✭ 43 (+152.94%)
Mutual labels:  jvm
jvm-dump-proxy
A proxy DLL for Windows to dump JVM classes at JNI level
Stars: ✭ 53 (+211.76%)
Mutual labels:  jvm
rxjava2-http
Transmit RxJava2 Flowable over http with non-blocking backpressure
Stars: ✭ 19 (+11.76%)
Mutual labels:  jvm
turtle
Run shell commands from a Kotlin script or application with ease
Stars: ✭ 128 (+652.94%)
Mutual labels:  jvm
SevenFacette
7Facette is an open-source multiplatform test automation library supporting JVM and JS.
Stars: ✭ 28 (+64.71%)
Mutual labels:  jvm
Latte-lang
100% Java compatibility and Functional Programming.
Stars: ✭ 128 (+652.94%)
Mutual labels:  jvm
tools jvm autodeps
Automatic Dependency Management Tools for JVM Languages
Stars: ✭ 48 (+182.35%)
Mutual labels:  jvm
arquillian-graphene
Robust Functional Tests leveraging WebDriver with flavour of neat AJAX-ready API
Stars: ✭ 91 (+435.29%)
Mutual labels:  jvm
review-notes
团队分享学习、复盘笔记资料共享。Java、Scala、Flink...
Stars: ✭ 27 (+58.82%)
Mutual labels:  jvm
kdl4j
KDL Parser for the JVM
Stars: ✭ 16 (-5.88%)
Mutual labels:  jvm
gctoolkit
Tool for parsing GC logs
Stars: ✭ 1,127 (+6529.41%)
Mutual labels:  jvm
distlock
The universal component of distributed locks in golang , support redis and postgresql
Stars: ✭ 60 (+252.94%)
Mutual labels:  distributed-lock
2p-kt
A Kotlin Multi-Platform ecosystem for symbolic AI
Stars: ✭ 52 (+205.88%)
Mutual labels:  jvm
wasm.cljc
Spec compliant WebAssembly compiler, decompiler, and generator
Stars: ✭ 178 (+947.06%)
Mutual labels:  jvm
pikt
🎨 Image-based poetic programming language.
Stars: ✭ 72 (+323.53%)
Mutual labels:  jvm
play-scala-streaming-example
Example Play application showing Comet and Server Sent Events in Scala
Stars: ✭ 42 (+147.06%)
Mutual labels:  jvm
JVMByPython
《自己动手写Java虚拟机》JVM的python实现
Stars: ✭ 110 (+547.06%)
Mutual labels:  jvm
Lastik
Kotlin Multiplatform + Jetpack Compose pet project, based on www.last.fm/api (in development)
Stars: ✭ 37 (+117.65%)
Mutual labels:  jvm
LGP
A robust Linear Genetic Programming implementation on the JVM using Kotlin.
Stars: ✭ 14 (-17.65%)
Mutual labels:  jvm

Sherlock Distributed Lock

Build Status Coverage Status Maven Central JavaDoc

Java Distributed lock library with database migration capabilities

Look for details in the documentation.

Sample usage

Add dependency to build.gradle:

dependencies {
  implementation "com.coditory.sherlock:sherlock-mongo-sync:0.4.14"
}

Create synchronous MongoDB backed lock:

// Get mongo locks collection
MongoClient mongoClient = MongoClients.create("mongodb://localhost:27017/sherlock");
MongoCollection<Document> collection = mongoClient
    .getDatabase("sherlock")
    .getCollection("locks");

// Create sherlock
Sherlock sherlock = MongoSherlock.builder()
    .withLocksCollection(collection)
    .build();

// Create a lock
DistributedLock lock = sherlock.createLock("sample-lock");

// Acquire a lock
lock.acquireAndExecute(() -> {
    System.out.println("Lock granted!");
});
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].