internal DatabaseInstanceData(IDatabase redisDb, IObjMemCache cache) { MemoryCache = cache; MemoryStrings = new MemoryStrings(MemoryCache); MemoryHashes = new MemoryHashes(MemoryCache); MemorySets = new MemorySets(MemoryCache); MemorySortedSets = new MemorySortedSet(MemoryCache); //If we have access to a redis instance, then listen to it for notifications if (redisDb != null) { Listener = new NotificationListener(redisDb.Multiplexer); //Connect the memory cache to the listener. Its data will be updated when keyspace events occur. Listener.HandleKeyspaceEvents(this); } }
internal MemoryStrings(IObjMemCache memCache) { _memCache = memCache; }
internal DatabaseInstanceData GetDatabaseInstanceData(string dbIdentifier, IDatabase redisDb, IObjMemCache cache) { //Check if this db is already registered, and register it for notifications if necessary lock (_lockObj) { if (!dbData.ContainsKey(dbIdentifier)) { dbData.Add(dbIdentifier, new DatabaseInstanceData(redisDb, cache)); } } return(dbData[dbIdentifier]); }
internal MemorySets(IObjMemCache objMemCache) { _objMemCache = objMemCache; }
internal MemoryHashes(IObjMemCache objMemCache) { _objMemCache = objMemCache; }
internal MemorySortedSet(IObjMemCache objMemCache) { _objMemCache = objMemCache; }