module Redlock::Scripts

Constants

LOCK_SCRIPT

thanks to github.com/sbertrang/redis-distlock/blob/master/lib/Redis/DistLock.pm also github.com/sbertrang/redis-distlock/issues/2 which proposes the value-checking and @maltoe for github.com/leandromoreira/redlock-rb/pull/20#discussion_r38903633

LOCK_SCRIPT_SHA
PTTL_SCRIPT
PTTL_SCRIPT_SHA
UNLOCK_SCRIPT
UNLOCK_SCRIPT_SHA

We do not want to load the scripts on every Redlock::Client initialization. Hence, we rely on Redis handing out SHA1 hashes of the cached scripts and pre-calculate them instead of loading the scripts unconditionally. If the scripts have not been cached on Redis, ‘recover_from_script_flush` has our backs.