private object internalGet(int index) { var obj = innerCollection[index]; if (obj != null || redisUtility == null) { return(obj); } object serializedItem; lock (serializedItemsLock) { serializedItem = serializedItems.Get(index); } if (serializedItem == null) { return(null); } innerCollection[index] = obj = redisUtility.GetObjectFromBytes((byte[])serializedItem); return(obj); }
public object Add(string key, object entry, DateTime utcExpiry) { key = GetKeyForRedis(key); TimeSpan expiryTime = utcExpiry - DateTime.UtcNow; string[] keyArgs = new string[] { key }; object[] valueArgs = new object[] { RedisUtility.GetBytesFromObject(entry), expiryTime.TotalMilliseconds }; object rowDataFromRedis = redisConnection.Eval(addScript, keyArgs, valueArgs); return(RedisUtility.GetObjectFromBytes(redisConnection.GetOutputCacheDataFromResult(rowDataFromRedis))); }
public object Get(string key) { key = GetKeyForRedis(key); byte[] data = redisConnection.Get(key); return(RedisUtility.GetObjectFromBytes(data)); }