lua.CountDownLatchCountScript.lua Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of redpulsar-core Show documentation
Show all versions of redpulsar-core Show documentation
Provides core functionality for RedPulsar Distributed locks and utilities.
The newest version!
redis.call("sadd", KEYS[1], ARGV[1])
if redis.call("pttl", KEYS[1]) == -1 then
redis.call("pexpire", KEYS[1], ARGV[2])
else
redis.call("pexpire", KEYS[1], ARGV[2], "GT")
end
local elementsCount = redis.call("scard", KEYS[1])
if elementsCount >= tonumber(ARGV[3]) then
redis.call("publish", KEYS[2], "open")
end
return "OK"