Exemplo n.º 1
0
 public values_preloaded_in_cache()
 {
     _cache = CacheBuilder
              .With <string, string>(UpdateWithKeyAndTime)
              .RefreshEvery(TimeSpan.FromMilliseconds(100))
              .Preload("a", "b", "c")
              .Build();
 }
Exemplo n.º 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();
 }
Exemplo n.º 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();
 }
Exemplo n.º 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();
 }