Exemplo n.º 1
0
        private async Task CacheUpdateAction(object sender, CacheUpdateNotificationArgs e)
        {
            var remoteItem = await _cacheSubscriber.GetAsync(e.Key, _knownTypes.GetOrAdd(e.Type, Type.GetType(e.Type)));

            if (e.SpecificTimeToLive != null)
            {
                Add(e.Key, remoteItem, e.SpecificTimeToLive._timeToLive);
            }
            else
            {
                Add(e.Key, remoteItem);
            }
        }
Exemplo n.º 2
0
        private async Task CacheUpdateAction(object sender, CacheUpdateNotificationArgs e)
        {
            var remoteItem = await _cacheSubscriber.GetAsync(e.Key, _knownTypes.GetOrAdd(e.Type, Type.GetType(e.Type)));

            Add(e.Key, remoteItem);
        }
Exemplo n.º 3
0
 private async void OnCacheUpdate(object sender, CacheUpdateNotificationArgs e)
 {
     await CacheUpdateAction(sender, e);
 }
Exemplo n.º 4
0
 private void OnCacheDelete(object sender, CacheUpdateNotificationArgs e)
 {
     Remove(e.Key);
 }