Constant Field Values

Contents

io.agentscope.*

  • io.agentscope.extensions.redis.state.RedisStateVersionSupport
    Modifier and Type
    Constant Field
    Value
    public static final String
    "local function current_version()\n if redis.call(\'EXISTS\', KEYS[2]) == 1 then\n return tonumber(redis.call(\'GET\', KEYS[2]))\n end\n if redis.call(\'EXISTS\', KEYS[1]) == 1 then\n return 0\n end\n return 0\nend\n\nlocal expected = tonumber(ARGV[2])\nif expected == -1 then\n local newVersion = 1\n if redis.call(\'EXISTS\', KEYS[2]) == 1 then\n newVersion = tonumber(redis.call(\'GET\', KEYS[2])) + 1\n end\n redis.call(\'SET\', KEYS[1], ARGV[1])\n redis.call(\'SET\', KEYS[2], newVersion)\n redis.call(\'SADD\', KEYS[3], ARGV[3])\n return newVersion\nend\n\nlocal current = current_version()\nif current ~= expected then\n return -1\nend\n\nlocal newVersion = expected + 1\nredis.call(\'SET\', KEYS[1], ARGV[1])\nredis.call(\'SET\', KEYS[2], newVersion)\nredis.call(\'SADD\', KEYS[3], ARGV[3])\nreturn newVersion\n"
    public static final String
    "-1"
    public static final String
    ":ver"