We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
@Override public RFuture<Boolean> containsAsync(Object o) { return commandExecutor.evalReadAsync(getName(), codec, RedisCommands.EVAL_BOOLEAN, "local s = redis.call('llen', KEYS[1]);" + "for i = 0, s-1, 1 do " + "local v = redis.call('lindex', KEYS[1], i);" + "local randomId, value = struct.unpack('dLc0', v);" + "if ARGV[1] == value then " + "return 1;" + "end; " + "end;" + "return 0;", Collections.<Object>singletonList(queueName), encode(o)); }
The text was updated successfully, but these errors were encountered:
The remove method is also the same.
remove
Sorry, something went wrong.
zrank won't help since randomId is unknown
Just delay the queue name and the obj to be queried
➜ Desktop redis-cli 127.0.0.1:6379> zrank redisson_delay_queue_timeout:{TOKEN_TIMEOUT_HANDLE} abcd (integer) 8 127.0.0.1:6379> zrank redisson_delay_queue_timeout:{TOKEN_TIMEOUT_HANDLE} abcde (nil) 127.0.0.1:6379>
Here is a Lua script impl
local exists = redis.call('ZRANK', KEYS[1], ARGV[1]) if exists == nil then return 0 else return 1 end
how do you send ARGV[1] ? it's stored with extra randomId to ensure uniqueness
No branches or pull requests
Would it be possible to optimize it using zrank and zscore to achieve O(log(N)) time complexity?
The text was updated successfully, but these errors were encountered: