Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use extend to implement heartbeat #21

Closed

Conversation

seamusabshere
Copy link
Contributor

(this PR depends on #20)

here's a tested example of implementing a heartbeat using extend

lock_manager.lock(resource, ttl) do
  # this takes out a lock every second until the ttl is used up (plus a remainder at the end)
  # if this process is killed, the lock will expire quickly
end

it looks complicated, but that's a good reason that the library should implement it (i think?)

cc @antirez @maltoe @leandromoreira

@maltoe
Copy link
Collaborator

maltoe commented Oct 7, 2015

@seamusabshere Sorry for not commenting on this so far. I think you're right about this should be part of some library, but not of the core locking one, and could probably be even totally agnostic of the underlying lock technology. At the very least it adds far too much complexity to Redlock::Client.

@maltoe maltoe closed this Oct 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants