Hacker News new | ask | show | jobs
by JoshTriplett 1467 days ago
Have you considered a version that holds a lock as long as it maintains an HTTP connection (with periodic data sent to keep the connection alive), and when the connection closes, the lock is released? That would help prevent the lock from staying held.
1 comments

Conceptually, that's how it works, however, instead of keeping an HTTP connection open, lockable expects to receive periodic heartbeats /hearbeat to keep the lock acquired. The TTL is variable, and can be set depending on the use case.