예제 #1
0
 public values_preloaded_in_cache()
 {
     _cache = CacheBuilder
              .With <string, string>(UpdateWithKeyAndTime)
              .RefreshEvery(TimeSpan.FromMilliseconds(100))
              .Preload("a", "b", "c")
              .Build();
 }
예제 #2
0
 public exceptions_thrown_when_retrieving_values()
 {
     _cache = CacheBuilder
              .With <string, DateTime>(key => { throw new Exception("bad"); })
              .RefreshEvery(TimeSpan.FromMilliseconds(100))
              .Preload("a", "b")
              .Build();
 }
예제 #3
0
 public values_updated_in_cache()
 {
     _cache = CacheBuilder
              .With <string, DateTime>(key => DateTime.Now)
              .RefreshEvery(TimeSpan.FromMilliseconds(10000))
              .WithRampUpDuration(TimeSpan.FromMilliseconds(100))
              .Preload("a", "b")
              .Build();
 }
예제 #4
0
 public old_values_in_cache()
 {
     _cache = CacheBuilder
              .With <string, DateTime>(key =>
     {
         _count++;
         return(DateTime.Now);
     })
              .RefreshEvery(TimeSpan.FromMilliseconds(400))
              .EvictUnused()
              .Preload("a", "b")
              .Build();
 }