justalock
Distributed locks, zero setup required.A distributed lock is used to ensure that if one actor is using a shared resource, no other actor will use that resource. Locking is an important mechanism in distributed systems to prevent multiple actors from updating a single piece of data at the same time (and possibly corrupting the data in the process).
justalock provides publicly available locks on demand.Try It Now
curl -vid $(head -c24 /dev/urandom | base64 -w0) https://justalock.dev/$(head -c16 /dev/urandom | base64 -w0 | tr /+ _-)
API & Libraries
- Make a
POST
request tohttps://justalock.dev/<lock_id>
to claim a lock - Use any 128-bit value as a lock ID (encoded as base64 or a UUID)
- Include up to 32 bytes in the request body to uniquely identify your client
- Specify the time-to-live of your lock with the
?s=<seconds>
query parameter - Receive a
200
response when you have the lock and a409
response when someone else has the lock