Exemple #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);
            }
        }
        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);
        }
 private async void OnCacheUpdate(object sender, CacheUpdateNotificationArgs e)
 {
     await CacheUpdateAction(sender, e);
 }
 private void OnCacheDelete(object sender, CacheUpdateNotificationArgs e)
 {
     Remove(e.Key);
 }