Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nitwhiz/omnilock
This is a locker. 🔒
https://github.com/nitwhiz/omnilock
lock-manager locker mutex sync
Last synced: 18 days ago
JSON representation
This is a locker. 🔒
- Host: GitHub
- URL: https://github.com/nitwhiz/omnilock
- Owner: nitwhiz
- Created: 2024-01-26T19:02:44.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-08-22T19:35:11.000Z (3 months ago)
- Last Synced: 2024-08-22T21:46:28.228Z (3 months ago)
- Topics: lock-manager, locker, mutex, sync
- Language: Go
- Homepage:
- Size: 26.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# omnilock
A zero dependency locker.
## How does it work?
This locker uses TCP connections to keep track of locks.
This way, a lock is freed as soon as the locking process ends (some way or another) or it's unlocked explicitly.## Protocol
1. Open a TCP connection to the omnilock server
2. Send a lock command through the established connection (e.g. `lock my_lock`)
3. Read the response, it may be either `success`, `failed` or `error: something went wrong`
4. Do your things on the client side
5. Either unlock the lock explicitly: `unlock my_lock` or just let the process exit so the OS closes the connectionNote: All commands and responses end with `\n` (newline).
## Usage as docker image
Start the server with:
```shell
docker run --rm -it -p 7194:7194 ghcr.io/nitwhiz/omnilock:latest
```And connect to it via port 7194.