Пример #1
0
        internal static void InitLoadedLuas(RedisInstanceSetting redisInstanceSetting, ILogger logger)
        {
            IServer server = RedisInstanceManager.GetServer(redisInstanceSetting, logger);

            _loadedLuas = new LoadedLuas
            {
                LoadedLockLua   = server.ScriptLoad(_luaLock),
                LoadedUnLockLua = server.ScriptLoad(_luaUnlock),
                LoadedExtendLua = server.ScriptLoad(_luaExtend)
            };
        }
Пример #2
0
        private void InitLoadedLuas()
        {
            foreach (RedisInstanceSetting setting in _options.ConnectionSettings)
            {
                IServer    server     = RedisInstanceManager.GetServer(setting, _logger);
                LoadedLuas loadedLuas = new LoadedLuas
                {
                    LoadedBatchAddLua    = server.ScriptLoad(_luaBatchAdd),
                    LoadedBatchUpdateLua = server.ScriptLoad(_luaBatchUpdate),
                    LoadedBatchDeleteLua = server.ScriptLoad(_luaBatchDelete),
                    LoadedBatchGetLua    = server.ScriptLoad(_luaBatchGet),
                    LoadedGetAllLua      = server.ScriptLoad(_luaGetAll)
                };

                _loadedLuaDict[setting.InstanceName] = loadedLuas;
            }
        }
Пример #3
0
        /// <summary>
        /// 各服务器反复Load也没有关系
        /// </summary>
        protected void InitLoadedLuas()
        {
            foreach (RedisInstanceSetting setting in _options.ConnectionSettings)
            {
                IServer    server     = RedisInstanceManager.GetServer(setting, _logger);
                LoadedLuas loadedLuas = new LoadedLuas
                {
                    LoadedSetWithTimestampLua    = server.ScriptLoad(RedisCache.LUA_SET_WITH_TIMESTAMP),
                    LoadedRemoveWithTimestampLua = server.ScriptLoad(RedisCache.LUA_REMOVE_WITH_TIMESTAMP),
                    LoadedGetAndRefreshLua       = server.ScriptLoad(RedisCache.LUA_GET_AND_REFRESH),

                    LoadedEntitiesGetAndRefreshLua            = server.ScriptLoad(RedisCache.LUA_ENTITIES_GET_AND_REFRESH),
                    LoadedEntitiesGetAndRefreshByDimensionLua = server.ScriptLoad(RedisCache.LUA_ENTITIES_GET_AND_REFRESH_BY_DIMENSION),
                    LoadedEntitiesSetLua               = server.ScriptLoad(RedisCache.LUA_ENTITIES_SET),
                    LoadedEntitiesRemoveLua            = server.ScriptLoad(RedisCache.LUA_ENTITIES_REMOVE),
                    LoadedEntitiesRemoveByDimensionLua = server.ScriptLoad(RedisCache.LUA_ENTITIES_REMOVE_BY_DIMENSION),

                    LoadedEntitiesForcedRemoveLua            = server.ScriptLoad(RedisCache.LUA_ENTITIES_REMOVE_FORECED_NO_VERSION),
                    LoadedEntitiesForcedRemoveByDimensionLua = server.ScriptLoad(RedisCache.LUA_ENTITIES_REMOVE_BY_DIMENSION_FORCED_NO_VERSION),
                };

                _loadedLuaDict[setting.InstanceName] = loadedLuas;
            }
        }
Пример #4
0
        private void InitLodedLua()
        {
            IServer server = RedisInstanceManager.GetServer(_instanceSetting, _logger);

            _loadedHistoryLua = server.ScriptLoad(_hISTORY_REDIS_SCRIPT);
        }