Created
February 25, 2021 08:53
-
-
Save kinnalru/95cafbcf89db97b0df5e1979bdda8b12 to your computer and use it in GitHub Desktop.
Iframe embed example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Lusnoc::Mutex.new('/some/key').synchronize do |mx| | |
# do some work | |
mx.renew if mx.need_renew? # manualy renew session if needed | |
# do other work | |
mx.renew if mx.need_renew? # manualy renew session if needed | |
# ... | |
rescue Lusnoc::ExpiredError => e | |
# Session was invalidated and mutex was lost! | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment