Skip to content

Commit 2122c8c

Browse files
committed
Improve documentation
1 parent 35e50dd commit 2122c8c

24 files changed

+127
-266
lines changed

.github/workflows/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
paths:
88
- 'docs/**'
99
- 'mkdocs.yml'
10-
- 'requirements.txt'
10+
- 'mkdocs-requirements.txt'
1111

1212
jobs:
1313
docs:
@@ -17,5 +17,5 @@ jobs:
1717
- uses: actions/setup-python@v2
1818
with:
1919
python-version: 3.x
20-
- run: pip install mkdocs-material -r requirements.txt
20+
- run: pip install mkdocs -r mkdocs-requirements.txt
2121
- run: mkdocs gh-deploy --force

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
## [Unreleased]
44

5-
## [0.4.11] - 2021-11-23
5+
## [0.4.11] - 2021-11-24
66
### Changed
77
- Update dependencies
8+
- Clean up documentation
89

910
## [0.4.10] - 2021-11-23
1011
### Changed
@@ -19,7 +20,6 @@
1920
### Changed
2021
- Fix documentation
2122

22-
2323
[Unreleased]: https://github.com/coditory/sherlock-distributed-lock/compare/v0.4.11...HEAD
2424
[0.4.11]: https://github.com/coditory/sherlock-distributed-lock/releases/tag/v0.4.11
2525
[0.4.10]: https://github.com/coditory/sherlock-distributed-lock/releases/tag/v0.4.10

README.md

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,44 @@
33
[![Coverage Status](https://coveralls.io/repos/github/coditory/sherlock-distributed-lock/badge.svg)](https://coveralls.io/github/coditory/sherlock-distributed-lock)
44
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.coditory.sherlock/sherlock-api-sync/badge.svg)](https://search.maven.org/search?q=com.coditory.sherlock)
55
[![JavaDoc](http://www.javadoc.io/badge/com.coditory.sherlock/sherlock-api-sync.svg)](http://www.javadoc.io/doc/com.coditory.sherlock/sherlock-api-sync)
6-
[![Join the chat at https://gitter.im/coditory/sherlock-distributed-lock](https://badges.gitter.im/coditory/sherlock-distributed-lock.svg)](https://gitter.im/coditory/sherlock-distributed-lock?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
76

8-
## Distributed lock JVM library
7+
> Distributed lock library for JVM projects
98
10-
Sherlock Distributed Lock is a JVM library that provides distributed locking mechanism.
11-
It uses a database to store locks and exposes both synchronous and reactive API.
12-
It was created as a simple solution to manage distributed locks among multiple microservices.
9+
Look for details in the [documentation](https://coditory.github.io/sherlock-distributed-lock/).
10+
11+
- **minimal dependency** - the main dependency is database driver that is probably already used in your project
12+
- **provides different [types of locks](https://coditory.github.io/sherlock-distributed-lock/locs)** - small but flexible
13+
- **provides [migration capabilities](https://coditory.github.io/sherlock-distributed-lock/migrator)** - no need for another library for database migration process
14+
- **exposes [synchronous and reactive API](https://coditory.github.io/sherlock-distributed-lock/api)** - changing API should not be a revolution
15+
16+
## Sample usage
17+
18+
Add dependency to `build.gradle`:
19+
```groovy
20+
dependencies {
21+
compile "com.coditory.sherlock:sherlock-mongo-sync:1.4.10"
22+
}
23+
```
24+
25+
Create synchronous MongoDB backed lock:
26+
```java
27+
// Get mongo locks collection
28+
MongoClient mongoClient = MongoClients.create("mongodb://localhost:27017/sherlock");
29+
MongoCollection<Document> collection = mongoClient
30+
.getDatabase("sherlock")
31+
.getCollection("locks");
32+
33+
// Create sherlock
34+
Sherlock sherlock = MongoSherlock.builder()
35+
.withLocksCollection(collection)
36+
.build();
37+
38+
// Create a lock
39+
DistributedLock lock = sherlock.createLock("sample-lock");
40+
41+
// Acquire a lock
42+
lock.acquireAndExecute(() -> {
43+
System.out.println("Lock granted!");
44+
});
45+
```
1346

14-
For details go to the [documentation](https://coditory.github.io/sherlock-distributed-lock/).

docs/about.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- [GitHub Repository](https://github.com/coditory/sherlock-distributed-lock/)
2+
- [License](https://github.com/coditory/sherlock-distributed-lock/blob/master/LICENSE)
3+
- [Changelog](https://github.com/coditory/sherlock-distributed-lock/blob/master/CHANGELOG.md)

docs/about/changelog.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/about/license.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/api.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/api/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Sherlock API
2+
3+
Sherlock exposes synchronous and reactive API in order to fit any code base. Exposed APIs:
4+
5+
- [Synchronous API](synchronous.md) - Synchronous API that uses blocking database connectors
6+
- [Reactor API](reactor.md) - Reactive API that uses [Reactor](https://projectreactor.io/) and reactive database connectors
7+
- [RxJava API](rxjava.md) - Reactive API that uses [RxJava (v2)](https://github.com/ReactiveX/RxJava) and reactive database connectors

docs/assets/img/favicon.png

-7.95 KB
Loading
-58.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)