Exemplo n.º 1
0
 public override void Add(string key, object item, DateTime absoluteExpiration, TimeSpan slidingExpiration)
 {
     AcquireWriterLock();
     try
     {
         CachedItem cachedItem = new CachedItem(key, item, absoluteExpiration, slidingExpiration);
         dictionary.Add(cachedItem.Key, cachedItem);
     }
     finally
     {
         ReleaseWriterLock();
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Sends an update for the specified CachedItem to all configured servers.
 /// </summary>
 /// <param name="client">The SessionClient used to send the update.</param>
 /// <param name="item">The CachedItem to be sent to all configured servers.</param>
 private void SendCommunique(SessionClient client, CachedItem item)
 {
     Communique communique = new Communique(item);
     client.SendCommunique(communique);
 }