Skip to content

Instantly share code, notes, and snippets.

@phstc
Created September 11, 2014 18:02
Show Gist options
  • Save phstc/5c4d0047166fe680e3f0 to your computer and use it in GitHub Desktop.
Save phstc/5c4d0047166fe680e3f0 to your computer and use it in GitHub Desktop.
Easy distributed locks using Redis - https://wombat.co/blog/easy_distributed_locks_using_redis/
# Lock while executing `do_something` or expire in 10 seconds
Wombat::Mutex.exclusive 'my_key', 10 do
do_something
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment